Search in sources :

Example 1 with IntegerLiteralAnnotationTerm

use of org.eclipse.ceylon.compiler.java.codegen.IntegerLiteralAnnotationTerm 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;
    }
}
Also used : IntegerLiteralAnnotationTerm(org.eclipse.ceylon.compiler.java.codegen.IntegerLiteralAnnotationTerm) CollectionLiteralAnnotationTerm(org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm)

Aggregations

CollectionLiteralAnnotationTerm (org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm)1 IntegerLiteralAnnotationTerm (org.eclipse.ceylon.compiler.java.codegen.IntegerLiteralAnnotationTerm)1