public List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e) { return this.env.getElementUtils().getAllAnnotationMirrors(e); }
processingEnv.getElementUtils().getTypeElement(RequiredAnnotation.class.getName()).asType(); for (final AnnotationMirror annotation : processingEnv.getElementUtils().getAllAnnotationMirrors(element)) { AnnotationMirror requiredAnnotationMirror = getAnnotationMirror(
/** * Iterates all elements of a type to check whether they contain the id annotation. If so the placement of this * annotation determines the access type * * @param searchedElement the type to be searched * @param context The global execution context * * @return returns the access type of the element annotated with the id annotation. If no element is annotated * {@code null} is returned. */ private static AccessType getAccessTypeInCaseElementIsRoot(TypeElement searchedElement, Context context) { List<? extends Element> myMembers = searchedElement.getEnclosedElements(); for ( Element subElement : myMembers ) { List<? extends AnnotationMirror> entityAnnotations = context.getElementUtils().getAllAnnotationMirrors( subElement ); for ( Object entityAnnotation : entityAnnotations ) { AnnotationMirror annotationMirror = (AnnotationMirror) entityAnnotation; if ( isIdAnnotation( annotationMirror ) ) { return getAccessTypeOfIdAnnotation( subElement ); } } } return null; }
void addAnnotations(Element e, Set<TypeElement> p) { for (AnnotationMirror annotationMirror : elements.getAllAnnotationMirrors(e) ) { Element e2 = annotationMirror.getAnnotationType().asElement(); p.add((TypeElement) e2); } }
private void processTypeAnnotations() { annotations = elementUtils .getAllAnnotationMirrors(modelElt) .stream() .map(annotationValueInfoFactory::processAnnotation) .collect(Collectors.toList()); }
public static AnnotationMirror getAnnotation(Elements elementUtils, Element annotationTarget, String annotationName) { for (AnnotationMirror annotation : elementUtils.getAllAnnotationMirrors(annotationTarget)) { if (annotationName.contentEquals(getQualifiedName(annotation))) { return annotation; } } return null; }
protected AnnotationMirror findAnnotationOn(Element e, String name) { for (AnnotationMirror a : elementUtils.getAllAnnotationMirrors(e)) if (elementUtils.getBinaryName((TypeElement) a.getAnnotationType().asElement()).contentEquals(name)) return a; return null; }
@Override public Set<TypeElement> scan(Element e, Set<TypeElement> p) { for (AnnotationMirror annotationMirror : elements.getAllAnnotationMirrors(e) ) { Element e2 = annotationMirror.getAnnotationType().asElement(); p.add((TypeElement) e2); } return super.scan(e, p); } }
@Override public Set<TypeElement> scan(Element e, Set<TypeElement> p) { for (AnnotationMirror annotationMirror : elements.getAllAnnotationMirrors(e) ) { Element e2 = annotationMirror.getAnnotationType().asElement(); p.add((TypeElement) e2); } return super.scan(e, p); } }
@Override public Set<Element> scan(Element e, DeclaredType p) { java.util.List<? extends AnnotationMirror> annotationMirrors = processingEnv.getElementUtils().getAllAnnotationMirrors(e); for (AnnotationMirror annotationMirror : annotationMirrors) { if (annotationMirror.getAnnotationType().equals(p)) annotatedElements.add(e); } e.accept(this, p); return annotatedElements; }
@Override protected Set<AnnotationMirror> getInterceptorBindings( Element element, WebBeansModel model ) { Set<AnnotationMirror> iBindings = super.getInterceptorBindings(element, model); List<? extends AnnotationMirror> annotations = model .getCompilationController().getElements() .getAllAnnotationMirrors(element); iBindings.retainAll(annotations); return iBindings; }
@Override public List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e) { while (e instanceof DecoratedElement) { e = ((DecoratedElement) e).getDelegate(); } return e instanceof ElementAdaptor ? ((ElementAdaptor)e).getAllAnnotationMirrors() : ElementDecorator.decorateAnnotationMirrors(delegate.getAllAnnotationMirrors(e), this.env); }
static boolean hasAnnotation( Element element, String annotation, AnnotationModelHelper helper ) { List<? extends AnnotationMirror> allAnnotationMirrors = helper.getCompilationController().getElements(). getAllAnnotationMirrors(element); return helper.hasAnnotation(allAnnotationMirrors, annotation ); }
static boolean checkSpecializedDefault( Element element , AnnotationModelHelper helper){ return helper.hasAnnotation( helper.getCompilationController(). getElements().getAllAnnotationMirrors(element), WebBeansModelProviderImpl.DEFAULT_QUALIFIER_ANNOTATION); }
@Override public boolean refresh( TypeElement type ) { List<? extends AnnotationMirror> allAnnotationMirrors = getHelper().getCompilationController().getElements(). getAllAnnotationMirrors(type); Map<String, ? extends AnnotationMirror> annotationsByType = getHelper().getAnnotationsByType( allAnnotationMirrors ); return annotationsByType.get( EnableBeansFilter.DECORATOR) != null ; }
@Override public boolean refresh( TypeElement type ) { List<? extends AnnotationMirror> allAnnotationMirrors = getHelper().getCompilationController().getElements(). getAllAnnotationMirrors(type); Map<String, ? extends AnnotationMirror> annotationsByType = getHelper().getAnnotationsByType( allAnnotationMirrors ); return annotationsByType.get( INTERCEPTOR ) != null ; }
private void fillDeclaredAnnotations( AnnotationParser parser, Element subjectElement ) { List<? extends AnnotationMirror> annotationMirrors = getController().getElements().getAllAnnotationMirrors( subjectElement ); AnnotationMirror annotationMirror = getHelper().getAnnotationsByType( annotationMirrors).get(INTERCEPTORS); if ( annotationMirror != null ){ parser.parse(annotationMirror); } }
@Override public boolean refresh( TypeElement type ) { List<? extends AnnotationMirror> allAnnotationMirrors = getHelper().getCompilationController().getElements(). getAllAnnotationMirrors(type); Map<String, ? extends AnnotationMirror> annotationsByType = getHelper().getAnnotationsByType( allAnnotationMirrors ); return annotationsByType.get( myStereotype) != null ; }
public List<T> createObjects(TypeElement type) { final List<T> result = new ArrayList<T>(); if (getHelper().hasAnnotation(getHelper().getCompilationController(). getElements().getAllAnnotationMirrors( type ), getAnnotationName())) { if ( checkType ( type )){ result.add(createObject(getHelper(), type)); } } return result; }
boolean refresh( TypeElement type ) { List<? extends AnnotationMirror> allAnnotationMirrors = getHelper().getCompilationController().getElements(). getAllAnnotationMirrors(type); Map<String, ? extends AnnotationMirror> annotationsByType = getHelper().getAnnotationsByType( allAnnotationMirrors ); if ( annotationsByType.get( getAnnotationName()) != null ){ return true; } return AnnotationObjectProvider.checkSuper(type, getAnnotationName(), getHelper())!= null; }