use of org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon by eclipse.
the class AnnotationLoader method readFloatValuesAnnotation.
private LiteralAnnotationTerm readFloatValuesAnnotation(AnnotationMirror valueAnnotation, boolean singleValue) {
if (singleValue) {
Double value = getAnnotationDoubleValues(valueAnnotation, "value").get(0);
FloatLiteralAnnotationTerm term = new FloatLiteralAnnotationTerm(value);
return term;
} else {
CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(FloatLiteralAnnotationTerm.FACTORY);
for (Double value : getAnnotationDoubleValues(valueAnnotation, "value")) {
result.addElement(new FloatLiteralAnnotationTerm(value));
}
return result;
}
}
use of org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon by eclipse.
the class AnnotationLoader method readObjectValuesAnnotation.
private LiteralAnnotationTerm readObjectValuesAnnotation(Module moduleScope, AnnotationMirror valueAnnotation, boolean singleValue) {
if (singleValue) {
TypeMirror klass = getAnnotationClassValues(valueAnnotation, "value").get(0);
Type type = modelLoader.obtainType(moduleScope, klass, null, null);
ObjectLiteralAnnotationTerm term = new ObjectLiteralAnnotationTerm(type);
return term;
} else {
CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(ObjectLiteralAnnotationTerm.FACTORY);
for (TypeMirror klass : getAnnotationClassValues(valueAnnotation, "value")) {
Type type = modelLoader.obtainType(moduleScope, klass, null, null);
result.addElement(new ObjectLiteralAnnotationTerm(type));
}
return result;
}
}
Aggregations