Search in sources :

Example 1 with CharacterLiteralAnnotationTerm

use of com.redhat.ceylon.compiler.java.codegen.CharacterLiteralAnnotationTerm in project ceylon-compiler by ceylon.

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

Aggregations

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