Search in sources :

Example 1 with DeclarationLiteralAnnotationTerm

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

Aggregations

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