Search in sources :

Example 1 with BooleanLiteralAnnotationTerm

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

Aggregations

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