this.typeEnvironment = typeEnvironment;
}
private void annotate(List<? extends AnnotationMirror> annotationMirrors) throws ProcessingException {
for (AnnotationMirror annotation: annotationMirrors) {
JAnnotationUse annotationUse = annotatable.annotate((AbstractJClass)toJType(annotation.getAnnotationType(), typeEnvironment));
for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> annotationValueAssignment: annotation.getElementValues().entrySet()) {
String name = annotationValueAssignment.getKey().getSimpleName().toString();
Object value = annotationValueAssignment.getValue().getValue();
if (value instanceof String)
annotationUse.param(name, (String)value);
else if (value instanceof Integer)
annotationUse.param(name, (Integer)value);
else if (value instanceof Long)
annotationUse.param(name, (Long)value);
else if (value instanceof Short)
annotationUse.param(name, (Short)value);
else if (value instanceof Float)
annotationUse.param(name, (Float)value);
else if (value instanceof Double)
annotationUse.param(name, (Double)value);
else if (value instanceof Byte)
annotationUse.param(name, (Byte)value);
else if (value instanceof Character)
annotationUse.param(name, (Character)value);
else if (value instanceof Class)
annotationUse.param(name, (Class)value);
else if (value instanceof Enum)
annotationUse.param(name, (Enum)value);
else if (value instanceof String[])
annotationUse.paramArray(name, (String[])value);
else if (value instanceof int[])
annotationUse.paramArray(name, (int[])value);
else if (value instanceof long[])
annotationUse.paramArray(name, (long[])value);
else if (value instanceof short[])
annotationUse.paramArray(name, (short[])value);
else if (value instanceof float[])
annotationUse.paramArray(name, (float[])value);
else if (value instanceof double[])
annotationUse.paramArray(name, (double[])value);
else if (value instanceof byte[])
annotationUse.paramArray(name, (byte[])value);
else if (value instanceof char[])
annotationUse.paramArray(name, (char[])value);
else if (value instanceof Class[])
annotationUse.paramArray(name, (Class[])value);
else if (value instanceof Enum[])
annotationUse.paramArray(name, (Enum[])value);
}
}
}