use of org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon by eclipse.
the class AnnotationLoader method readStringValuesAnnotation.
private LiteralAnnotationTerm readStringValuesAnnotation(AnnotationMirror valueAnnotation, boolean singleValue) {
if (singleValue) {
String value = getAnnotationStringValues(valueAnnotation, "value").get(0);
StringLiteralAnnotationTerm term = new StringLiteralAnnotationTerm(value);
return term;
} else {
CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(StringLiteralAnnotationTerm.FACTORY);
for (String value : getAnnotationStringValues(valueAnnotation, "value")) {
result.addElement(new StringLiteralAnnotationTerm(value));
}
return result;
}
}
use of org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon by eclipse.
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;
}
}
use of org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon by eclipse.
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 org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon by eclipse.
the class AnnotationLoader method readIntegerValuesAnnotation.
private LiteralAnnotationTerm readIntegerValuesAnnotation(AnnotationMirror valueAnnotation, boolean singleValue) {
if (singleValue) {
Long value = getAnnotationLongValues(valueAnnotation, "value").get(0);
IntegerLiteralAnnotationTerm term = new IntegerLiteralAnnotationTerm(value);
return term;
} else {
CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(IntegerLiteralAnnotationTerm.FACTORY);
for (Long value : getAnnotationLongValues(valueAnnotation, "value")) {
result.addElement(new IntegerLiteralAnnotationTerm(value));
}
return result;
}
}
use of org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm in project ceylon by eclipse.
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;
}
}
Aggregations