public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv) { if (resetResults) { processingResults = new HashMap<>(); } for (Element element : roundEnv.getElementsAnnotatedWith(Wid.class)) { if (element instanceof TypeElement) { TypeElement typeElement = (TypeElement) element; processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, MessageFormat.format("Wid Processor : processing class {0}.", typeElement.asType().toString())); processingResults.put(typeElement.asType().toString(), new ArrayList<>()); if (typeElement.getInterfaces() != null && typeElement.getInterfaces().size() > 0) { for (TypeMirror mirror : typeElement.getInterfaces()) { if (mirror.getAnnotation(Wid.class) != null) { processingResults.get(typeElement.asType().toString()).add(mirror.getAnnotation(Wid.class)); } } } processingResults.get(typeElement.asType().toString()).add(typeElement.getAnnotation(Wid.class)); } } return postProcessWorkItemDefinition(); }
public <A extends Annotation> A getAnnotation(Class<A> annotationType) { return this.delegate.getAnnotation(annotationType); }
public <A extends Annotation> A getAnnotation(Class<A> annotationType) { return this.delegate.getAnnotation(annotationType); }
@Nullable public static <A extends Annotation> A findAnnotationOnElementOrType(Element annotatedElement, Class<A> annotationType) { A elementAnnotation = annotatedElement.getAnnotation(annotationType); if (elementAnnotation != null) { return elementAnnotation; } TypeMirror elementType = ElementUtils.getType(annotatedElement); return elementType.getAnnotation(annotationType); }
public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv) { if (resetResults) { processingResults = new HashMap<>(); } for (Element element : roundEnv.getElementsAnnotatedWith(Wid.class)) { if (element instanceof TypeElement) { TypeElement typeElement = (TypeElement) element; processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, MessageFormat.format("Wid Processor : processing class {0}.", typeElement.asType().toString())); processingResults.put(typeElement.asType().toString(), new ArrayList<>()); if (typeElement.getInterfaces() != null && typeElement.getInterfaces().size() > 0) { for (TypeMirror mirror : typeElement.getInterfaces()) { if (mirror.getAnnotation(Wid.class) != null) { processingResults.get(typeElement.asType().toString()).add(mirror.getAnnotation(Wid.class)); } } } processingResults.get(typeElement.asType().toString()).add(typeElement.getAnnotation(Wid.class)); } } return postProcessWorkItemDefinition(); }
@Override public boolean isMandatory() { return !(this.hasDefaultValue() || this.hasAnnotation(Nullable.class) || this.getGetter().getReturnType().getAnnotation(Nullable.class) != null || getSetter() != null); }