Search in sources :

Example 1 with CharacterLiteralAnnotationTerm

use of org.eclipse.ceylon.compiler.java.codegen.CharacterLiteralAnnotationTerm in project ceylon by eclipse.

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(org.eclipse.ceylon.compiler.java.codegen.CharacterLiteralAnnotationTerm) CollectionLiteralAnnotationTerm(org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm)

Aggregations

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