Search in sources :

Example 1 with AnnotationParamExtractor

use of org.androidannotations.internal.helper.AnnotationParamExtractor in project androidannotations by androidannotations.

the class APTCodeModelHelper method copyAnnotation.

public void copyAnnotation(IJAnnotatable annotatable, AnnotationMirror annotationMirror) {
    Map<? extends ExecutableElement, ? extends AnnotationValue> parameters = annotationMirror.getElementValues();
    if (!hasAnnotation(annotatable, annotationMirror)) {
        AbstractJClass annotation = typeMirrorToJClass(annotationMirror.getAnnotationType());
        JAnnotationUse annotate = annotatable.annotate(annotation);
        for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> param : parameters.entrySet()) {
            param.getValue().accept(new AnnotationParamExtractor(annotate, this), param.getKey().getSimpleName().toString());
        }
    }
}
Also used : JAnnotationUse(com.helger.jcodemodel.JAnnotationUse) AbstractJClass(com.helger.jcodemodel.AbstractJClass) AnnotationParamExtractor(org.androidannotations.internal.helper.AnnotationParamExtractor) Map(java.util.Map) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

AbstractJClass (com.helger.jcodemodel.AbstractJClass)1 JAnnotationUse (com.helger.jcodemodel.JAnnotationUse)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 AnnotationParamExtractor (org.androidannotations.internal.helper.AnnotationParamExtractor)1