Search in sources :

Example 1 with BooleanLiteralAnnotationTerm

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

Aggregations

BooleanLiteralAnnotationTerm (com.redhat.ceylon.compiler.java.codegen.BooleanLiteralAnnotationTerm)1 CollectionLiteralAnnotationTerm (com.redhat.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm)1