Search in sources :

Example 1 with FloatLiteralAnnotationTerm

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

the class AnnotationLoader method readFloatValuesAnnotation.

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

Aggregations

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