@Override public MutableDeclaredType getAnnotationType() { return mutableAnnotation.getAnnotationType(); }
@Override public Map<? extends MutableExecutableType, ? extends MutableTypeValue> getElementValues() { return mutableAnnotation.getElementValues(); }
@Override public MutableAnnotationMirror setAnnotationValue(String methodName, MutableTypeValue value) { return mutableAnnotation.setAnnotationValue(methodName, value); }
public void print(MutableAnnotationMirror annotation) { pw.print("@", annotation.getAnnotationType()); if (annotation.getElementValues().size() > 0) { pw.print("("); int i = 0; for (Entry<? extends MutableExecutableType, ? extends MutableTypeValue> annotationValue: annotation.getElementValues().entrySet()) { if (i > 0) { pw.print(", "); if (pw.getCurrentPosition() > FormattedPrintWriter.LINE_LENGTH) { pw.println(); pw.print(" "); } } pw.print(annotationValue.getKey().getSimpleName() + " = ", annotationValue.getValue()); i++; } pw.print(")"); } pw.println(); }
@Override public boolean isAnnotationIgnored(MutableAnnotationMirror annotation) { return isAnnotationIgnored(annotation.getAnnotationType().toString()); } }
public MutableAnnotationMirror merge(MutableAnnotationMirror annotationMirror, AnnotationMirror annotation) { for (Entry<? extends ExecutableElement, ? extends AnnotationValue> annotationMethod: annotation.getElementValues().entrySet()) { AnnotationValue value = annotationMethod.getValue(); Object result = value.accept(new AnnotationValueVisitor(this.processingEnv, annotationMethod.getKey().getReturnType()), value); if (result == null) { result = value; } annotationMirror.setAnnotationValue(annotationMethod.getKey().getSimpleName().toString(), processingEnv.getTypeUtils().getAnnotationTypeValue(result)); } return annotationMirror; }
protected MutableAnnotationMirror get(List<MutableAnnotationMirror> annotations, AnnotationMirror annotation) { for (MutableAnnotationMirror annotationMirror: annotations) { if (annotationMirror.getAnnotationType().getCanonicalName().equals(annotation.getAnnotationType().toString())) { return annotationMirror; } } return null; }
public MutableAnnotationMirror setAnnotationValue(String methodName, Object value) { return mutableAnnotation.setAnnotationValue(methodName, processingEnv.getTypeUtils().getTypeValue(value)); }