public void run(CompilationController controller) throws Exception { Elements elements = controller.getElements(); TypeElement te = elements.getTypeElement(fqName); result = (te != null); }
@Override public void run(CompilationController controller) throws IOException { controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); TypeElement typeElement = controller.getElements().getTypeElement(entityClass); enumerateEntityFields(params, controller, typeElement, managedBeanProperty, collectionComponent, initValueGetters); } }, true);
private static void loadJsfResourcesElementsHandles(CompilationController parameter) { jsfResourcesElementHandles = new ArrayList<ElementHandle>(JSF_RESOURCES.size()); for (String canonicalName : JSF_RESOURCES) { TypeElement typeElement = parameter.getElements().getTypeElement(canonicalName); if (typeElement != null) { jsfResourcesElementHandles.add(ElementHandle.create(typeElement)); } } }
public void run(CompilationController controller) throws IOException { controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); TypeElement typeElement = controller.getElements().getTypeElement(entityClass); createParamsForConverterTemplate(params, controller, typeElement, embeddedPkSupport); } }, true);
@Override public void run(CompilationController controller) throws IOException { Elements elements = controller.getElements(); TypeElement thisElement = elements.getTypeElement(referencingClass); if (thisElement!=null) { isInjectionTarget[0] = InjectionTargetQuery.isInjectionTarget(controller, thisElement); } } @Override
public void run(CompilationController controller) throws IOException { controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); TypeElement typeElement = controller.getElements().getTypeElement(entityClass); JsfTable.createTable(controller, typeElement, managedBean + "." + fieldName, tableBody, allCommands, embeddedPkSupport, tableVarName); } }, true);
@Override public void run(CompilationController controller) throws Exception { Elements elems = controller.getElements(); TypeElement fxAppElement = elems.getTypeElement(classType); ElementHandle<TypeElement> appHandle = ElementHandle.create(fxAppElement); Set<ElementHandle<TypeElement>> appHandles = classIndex.getElements(appHandle, kinds, scopes); for (ElementHandle<TypeElement> elemHandle : appHandles) { appClassNames.add(elemHandle.getQualifiedName()); } } @Override
@Override public void run(CompilationController info) { Elements elements = info.getElements(); addPackageElements(elements.getPackageElement(pkg)); addTypeElements(elements.getTypeElement(pkg)); }
@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 void run(CompilationController controller) throws IOException { controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); TypeElement typeElement = controller.getElements().getTypeElement(className); if (typeElement != null) { result[0] = SourceUtils.getFile(ElementHandle.create(typeElement), controller.getClasspathInfo()); } } }, true);
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( 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 ; }
static boolean isViewClass(ClassTree classT, CompilationController controller) { Trees trees = controller.getTrees(); TreePath classTPath = trees.getPath(controller.getCompilationUnit(), classT); TypeElement classEl = (TypeElement) trees.getElement(classTPath); TypeElement appEl = controller.getElements().getTypeElement("org.jdesktop.application.View"); // NOI18N Types types = controller.getTypes(); TypeMirror tm1 = types.erasure(classEl.asType()); TypeMirror tm2 = types.erasure(appEl.asType()); return types.isSubtype(tm1, tm2); }
@Override public boolean hasAlternative( Element element ){ List<? extends AnnotationMirror> annotations = getController(). getElements().getAllAnnotationMirrors(element); return getHelper().hasAnnotation(annotations, ALTERNATIVE); }
public void run(CompilationController cc) throws Exception { cc.toPhase(Phase.ELEMENTS_RESOLVED); if (eh != null) { TypeElement e = eh.resolve(cc); if (e != null && isAccessibleClass(e)) { delegate = SpringXMLConfigCompletionItem.createTypeItem(substitutionOffset, e, eh, cc.getElements().isDeprecated(e), true); } eh = null; } } }, true);
private static TypeElement getTypeElement(CompilationController ci, String binaryName, String[] classExcludeNames) { ClassScanner cs = new ClassScanner(ci.getTrees(), ci.getElements(), binaryName, classExcludeNames); TypeElement te = cs.scan(ci.getCompilationUnit(), null); if (te != null) { return te; } else { return 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; }