Search in sources :

Example 1 with StringLiteralAnnotationTerm

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

the class AnnotationLoader method readStringValuesAnnotation.

private LiteralAnnotationTerm readStringValuesAnnotation(AnnotationMirror valueAnnotation, boolean singleValue) {
    if (singleValue) {
        String value = getAnnotationStringValues(valueAnnotation, "value").get(0);
        StringLiteralAnnotationTerm term = new StringLiteralAnnotationTerm(value);
        return term;
    } else {
        CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(StringLiteralAnnotationTerm.FACTORY);
        for (String value : getAnnotationStringValues(valueAnnotation, "value")) {
            result.addElement(new StringLiteralAnnotationTerm(value));
        }
        return result;
    }
}
Also used : StringLiteralAnnotationTerm(org.eclipse.ceylon.compiler.java.codegen.StringLiteralAnnotationTerm) CollectionLiteralAnnotationTerm(org.eclipse.ceylon.compiler.java.codegen.CollectionLiteralAnnotationTerm)

Aggregations

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