static boolean isProvider(TypeElement type, AnnotationModelHelper helper) { if (type.getKind() != ElementKind.INTERFACE) { // don't consider interfaces if (helper.hasAnnotation(type.getAnnotationMirrors(), RestConstants.PROVIDER_ANNOTATION)) { // NOI18N return true; } } return false; }
static boolean isRestApplication(TypeElement type, AnnotationModelHelper helper) { boolean isRest = false; if (type != null && type.getKind() != ElementKind.INTERFACE) { // don't consider interfaces if (helper.hasAnnotation(type.getAnnotationMirrors(), RestConstants.APPLICATION_PATH)) { // NOI18N isRest = true; } } return isRest; }
@Override public List<WebserviceDescriptionImpl> createObjects(TypeElement type) { if (type.getKind() == ElementKind.CLASS) { // don't consider interfaces if (helper.hasAnnotation(type.getAnnotationMirrors(), "javax.jws.WebService")) { // NOI18N return Collections.singletonList(new WebserviceDescriptionImpl(helper, type)); } if (helper.hasAnnotation(type.getAnnotationMirrors(), "javax.xml.ws.WebServiceProvider")) { // NOI18N return Collections.singletonList(new WebserviceDescriptionImpl(helper, type)); } } return Collections.emptyList(); }
@Override public void handleAnnotation(TypeElement type, Element element, AnnotationMirror annotation) { if ( !set.contains( type )){ result.add( new BindingQualifier( getHelper(), type , getAnnotationName())); } set.add( type ); if ( !getHelper().hasAnnotation( annotation. getAnnotationType().asElement(). getAnnotationMirrors(), Inherited.class.getCanonicalName())) { /* * if annotation is inherited then method * findAnnotations() * method will return types with this annotation. * Otherwise there could be implementors which * specialize this type. */ collectSpecializedImplementors( type , set, result ); } }
@Override public List<T> createObjects( TypeElement type ) { if ((type.getKind() == ElementKind.CLASS || type.getKind() == ElementKind.INTERFACE) && getHelper().hasAnnotation(type.getAnnotationMirrors(), getAnnotation())) { return Collections.singletonList(createTypeElement(type)); } return Collections.emptyList(); }
private String checkInjectProducers(List<? extends AnnotationMirror> annotations) { if (getModel().getHelper().hasAnnotation(annotations, INJECT_ANNOTATION)) { return INJECT_ANNOTATION; } if ( getModel().getHelper().hasAnnotation(annotations, PRODUCER_ANNOTATION)) { return PRODUCER_ANNOTATION; } return null; }
static boolean isRest(TypeElement type, AnnotationModelHelper helper) { boolean isRest = false; if (type.getKind() != ElementKind.INTERFACE) { // don't consider interfaces if (!type.getModifiers().contains(Modifier.ABSTRACT)) { if (helper.hasAnnotation(type.getAnnotationMirrors(), RestConstants.PATH)) { // NOI18N isRest = true; } else { for (Element element : type.getEnclosedElements()) { if (Utils.hasHttpMethod(element)) { isRest = true; break; } } } } } return isRest; }
@Override public List<NamedStereotype> createObjects( TypeElement type ) { if (type.getKind() == ElementKind.ANNOTATION_TYPE && getHelper().hasAnnotation(type.getAnnotationMirrors(), getAnnotation())) { if ( hasNamed(type, getHelper())){ return Collections.singletonList(createTypeElement(type)); } } return Collections.emptyList(); }
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 hasAlternative( Element element ){ List<? extends AnnotationMirror> annotations = getController(). getElements().getAllAnnotationMirrors(element); return getHelper().hasAnnotation(annotations, ALTERNATIVE); }
newQualifier = getModel().getHelper().hasAnnotation(quilifierAnnotations, NEW_QUALIFIER_ANNOTATION); defaultQualifier = getModel().getHelper().hasAnnotation(quilifierAnnotations, DEFAULT_QUALIFIER_ANNOTATION); return getModel().getHelper().hasAnnotation(qualifiers, DEFAULT_QUALIFIER_ANNOTATION);
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; }
!getHelper().hasAnnotation(allAnnotations, DECORATOR ) ) break; if ( getHelper().hasAnnotation(allAnnotations, FieldInjectionPointLogic.INJECT_ANNOTATION))
getHelper().hasAnnotation( elementsUtil.getAllAnnotationMirrors( scopeElement), SCOPE) )
@Override public List<BindingQualifier> createObjects( TypeElement type ) { final List<BindingQualifier> result = new ArrayList<BindingQualifier>(); Map<String, ? extends AnnotationMirror> annotationsByType = getHelper().getAnnotationsByType(getHelper().getCompilationController(). getElements().getAllAnnotationMirrors( type )); AnnotationMirror annotationMirror = annotationsByType.get( getAnnotationName()); if (annotationMirror != null ) { result.add( new BindingQualifier(getHelper(), type, getAnnotationName())); } if ( annotationMirror == null || !getHelper().hasAnnotation( annotationMirror. getAnnotationType().asElement(). getAnnotationMirrors(), Inherited.class.getCanonicalName())) { if ( checkSuper( type , getAnnotationName() , getHelper())!= null ){ result.add( new BindingQualifier( getHelper(), type, getAnnotationName()) ); } } return result; }
private void setScope( Map<String, ? extends AnnotationMirror> types, TypeElement type ) boolean isCustom = getHelper().hasAnnotation(type.getAnnotationMirrors(), "javax.faces.bean.CustomScoped"); // NOI18N if ( isCustom ){ String annotation = entry.getKey(); ManagedBean.Scope scope = entry.getValue(); if ( getHelper().hasAnnotation(type.getAnnotationMirrors(), annotation) )
compilationController.getElements(). getAllAnnotationMirrors( parameter); if ( getModel().getHelper().hasAnnotation( annotationMirrors, OBSERVES_ANNOTATION) ){ result.add( new ObserverTriple( method, parameter, index) );
private boolean isMethodParameterInjection( VariableElement element, ExecutableElement parent ) throws org.netbeans.modules.web.beans.api.model.InjectionPointDefinitionError { List<? extends AnnotationMirror> annotations = getModel().getHelper().getCompilationController().getElements(). getAllAnnotationMirrors(parent); if (isDisposeParameter( element, parent, annotations)){ return true; } /* * Parameter with @Observes annotation is not plain injection point. */ boolean hasObserves = AnnotationObjectProvider.hasAnnotation(element, OBSERVES_ANNOTATION, getModel().getHelper()); if ( !hasObserves && isObservesParameter(element, parent, annotations)){ return true; } return getModel().getHelper().hasAnnotation(annotations, INJECT_ANNOTATION)|| getModel().getHelper().hasAnnotation(annotations, PRODUCER_ANNOTATION); }
@Override public boolean isInjectionPoint( VariableElement element ) throws org.netbeans.modules.web.beans.api.model.InjectionPointDefinitionError { Element parent = element.getEnclosingElement(); if ( parent instanceof TypeElement){ List<? extends AnnotationMirror> annotations = getModel().getHelper().getCompilationController().getElements(). getAllAnnotationMirrors(element); return getModel().getHelper().hasAnnotation(annotations, INJECT_ANNOTATION); } else if ( parent instanceof ExecutableElement ){ return isMethodParameterInjection(element,(ExecutableElement)parent); } return false; }