public Object run(CompilationInfo cinfo) { VariableElement field = getField(cinfo, name); if(field != null) { return ElementHandle.create(field); } return null; } }, fObj);
public Method(ExecutableElement element, JavaClass javaClass) { execElementHandle = ElementHandle.create(element); this.javaClass = javaClass; this.name = element.getSimpleName().toString(); }
/** Creates a new instance of TypeElementAdapter */ public JavaClass(TypeElement element, FileObject fObj) { this.fObj = fObj; typeElementHandle = ElementHandle.create(element); name = element.getQualifiedName().toString(); }
private void setCachedResult( List<Element> list) { myNamedElement = new ArrayList<ElementHandle<? extends Element>>( list.size()); for( Element element : list ){ myNamedElement.add( ElementHandle.create( element )); } }
private static void setVariablePath( Object[] variableAtCaret, CompilationController controller, Element element ) { Element parent = element.getEnclosingElement(); if ( parent instanceof ExecutableElement ){ ElementHandle<ExecutableElement> handle = ElementHandle.create( (ExecutableElement)parent ) ; variableAtCaret[0] = handle; variableAtCaret[1] = element.getSimpleName().toString(); variableAtCaret[2] = InspectActionId.INJECTABLES_CONTEXT; } }
public EventsModel( List<VariableElement> fields , CompilationController controller ,MetadataModel<WebBeansModel> model ) { super( null ); myModel = model; myHandles = new ArrayList<ElementHandle<VariableElement>>( fields.size()); for (VariableElement field : fields) { ElementHandle<VariableElement> handle = ElementHandle.create( field ); myHandles.add( handle ); } update( fields , controller ); }
public static Collection<ElementHandle<ExecutableElement>> getOverridenMethodsAsHandles(ExecutableElement e, CompilationInfo info) { Collection<ExecutableElement> methods = getOverridenMethods(e, info); if(methods.isEmpty()) { return Collections.emptyList(); } Collection<ElementHandle<ExecutableElement>> handles = new ArrayList<ElementHandle<ExecutableElement>>(methods.size()); for(ExecutableElement ee : methods) { handles.add(ElementHandle.create(ee)); } return handles; }
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 ObserversModel( List<ExecutableElement> methods , CompilationController controller ,MetadataModel<WebBeansModel> model ) { super( null ); myModel = model; myHandles = new ArrayList<ElementHandle<ExecutableElement>>( methods.size()); for (ExecutableElement method : methods) { ElementHandle<ExecutableElement> handle = ElementHandle.create( method ); myHandles.add( handle ); } update( methods , controller ); }
public MappedElement(final FileObject fileObject, final Element element, final String url, final RequestMethod method) { this.fileObject = fileObject; this.handle = ElementHandle.create(element); this.handlerMethod = computeHandlerSignature(element); this.resourceUrl = url; this.requestMethod = method; }
public JavaClassNode(ClasspathInfo cpInfo, Icon icon, boolean isAnonymous, TypeElement type, ContainerNode parent) { this(cpInfo, type.getSimpleName().toString(), icon, isAnonymous, type, parent); this.cpInfo = cpInfo; this.typeHandle = ElementHandle.create(type); signature = new SourceCodeSelection(ElementUtilities.getBinaryName(type), "*", ""); // NOI18N }
public static DeclarationLocation getDeclarationLocation(final ClasspathInfo cpInfo, final Element el) { ElementHandle<Element> handle = ElementHandle.create(el); FileObject fo = SourceUtils.getFile(handle, cpInfo); if (fo != null) { return getDeclarationLocation(fo, handle); } return DeclarationLocation.NONE; }
@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 controller) throws Exception { controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); TypeElement typeElement = ElementSearch.getClass(controller.getElements(), fqn); if (typeElement != null) { for (VariableElement variable : ElementFilter.fieldsIn(typeElement.getEnclosedElements())) { if (variable.getSimpleName().contentEquals(fieldName)) { handles[0] = ElementHandle.create(variable); } } } } }, true);
@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);
public JavaClassNode(ClasspathInfo cpInfo, String displayName, boolean isAnonymous, TypeElement type, ContainerNode parent) { super(ElementUtilities.getBinaryName(type), displayName, isAnonymous, parent); this.cpInfo = cpInfo; this.typeHandle = ElementHandle.create(type); signature = new SourceCodeSelection(ElementUtilities.getBinaryName(type), "*", ""); // NOI18N }
public void requireCdiEnabled( Element element , WebBeansModel model){ ElementHandle<Element> handle = ElementHandle.create(element); Element resolved = handle.resolve( getInfo() ); if ( resolved == null ){ return; } requireCdiEnabled( resolved ); }
public JavaClassNode(ClasspathInfo cpInfo, String displayName, Icon icon, boolean isAnonymous, TypeElement type, ContainerNode parent) { super(ElementUtilities.getBinaryName(type), displayName, icon, isAnonymous, parent); this.cpInfo = cpInfo; this.typeHandle = ElementHandle.create(type); signature = new SourceCodeSelection(ElementUtilities.getBinaryName(type), "*", ""); // NOI18N }
private void checkDecorators( TypeElement element, WebBeansModel model, Result result ) { Collection<TypeElement> decorators = model.getDecorators(element); if ( decorators!= null && decorators.size() >0 ){ EditorAnnotationsHelper helper = EditorAnnotationsHelper.getInstance(result); ElementHandle<TypeElement> handle = ElementHandle.create(element); if ( helper != null ){ helper.addDecoratedBean( result , handle.resolve( result.getInfo() )); } } }
public static ErrorDescription createNotification( Severity severity, Element subject , WebBeansModel model, CompilationInfo info , String description, Fix fix ) { ElementHandle<Element> handle = ElementHandle.create( subject ); Element element = handle.resolve(info); if ( element == null){ return null; } Tree elementTree = info.getTrees().getTree(element); return createNotification(severity, elementTree, info, description, fix ); }