use of com.redhat.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon-compiler by ceylon.
the class AnnotationLoader method readCharacterValuesAnnotation.
private LiteralAnnotationTerm readCharacterValuesAnnotation(AnnotationMirror valueAnnotation, boolean singleValue) {
if (singleValue) {
Integer value = getAnnotationIntegerValues(valueAnnotation, "value").get(0);
CharacterLiteralAnnotationTerm term = new CharacterLiteralAnnotationTerm(value);
return term;
} else {
CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(CharacterLiteralAnnotationTerm.FACTORY);
for (Integer value : getAnnotationIntegerValues(valueAnnotation, "value")) {
result.addElement(new CharacterLiteralAnnotationTerm(value));
}
return result;
}
}
use of com.redhat.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon-compiler by ceylon.
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 com.redhat.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon-compiler by ceylon.
the class AnnotationLoader method readDeclarationValuesAnnotation.
private LiteralAnnotationTerm readDeclarationValuesAnnotation(AnnotationMirror valueAnnotation, boolean singleValue) {
if (singleValue) {
String value = getAnnotationStringValues(valueAnnotation, "value").get(0);
DeclarationLiteralAnnotationTerm term = new DeclarationLiteralAnnotationTerm(value);
return term;
} else {
CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(DeclarationLiteralAnnotationTerm.FACTORY);
for (String value : getAnnotationStringValues(valueAnnotation, "value")) {
result.addElement(new DeclarationLiteralAnnotationTerm(value));
}
return result;
}
}
use of com.redhat.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon-compiler by ceylon.
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, 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, null);
result.addElement(new ObjectLiteralAnnotationTerm(type));
}
return result;
}
}
use of com.redhat.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon-compiler by ceylon.
the class AnnotationLoader method readBooleanValuesAnnotation.
private LiteralAnnotationTerm readBooleanValuesAnnotation(AnnotationMirror valueAnnotation, boolean singleValue) {
if (singleValue) {
boolean value = getAnnotationBooleanValues(valueAnnotation, "value").get(0);
BooleanLiteralAnnotationTerm term = new BooleanLiteralAnnotationTerm(value);
return term;
} else {
CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(BooleanLiteralAnnotationTerm.FACTORY);
for (Boolean value : getAnnotationBooleanValues(valueAnnotation, "value")) {
result.addElement(new BooleanLiteralAnnotationTerm(value));
}
return result;
}
}
Aggregations