use of org.eclipse.ceylon.langtools.tools.javac.code.Attribute.Compound in project ceylon by eclipse.
the class JavacAnnotation method attributeToRefl.
private Object attributeToRefl(Attribute attr) {
if (attr == null)
return null;
if (attr instanceof Attribute.Constant)
return attr.getValue();
if (attr instanceof Attribute.Array) {
Attribute[] values = ((Attribute.Array) attr).values;
List<Object> list = new ArrayList<Object>(values.length);
for (Attribute elem : values) {
list.add(attributeToRefl(elem));
}
return list;
}
if (attr instanceof Attribute.Compound)
return new JavacAnnotation((Compound) attr);
if (attr instanceof Attribute.Enum)
return ((Attribute.Enum) attr).getValue().name.toString();
if (attr instanceof Attribute.Class)
return new JavacType(((Attribute.Class) attr).getValue());
// FIXME: turn into error
throw new RuntimeException("Unknown attribute type: " + attr);
}