protected Set<Element> getChildSpecializes( Element productionElement, WebBeansModelImplementation model ) { TypeElement typeElement = model.getHelper().getCompilationController() .getElementUtilities().enclosingTypeElement(productionElement); Set<TypeElement> implementors = getImplementors(model, typeElement); implementors.remove( productionElement.getEnclosingElement()); Set<Element> specializeElements = new HashSet<Element>(); specializeElements.add(productionElement); for (TypeElement implementor : implementors) { inspectHierarchy(productionElement, implementor, specializeElements, model); } specializeElements.remove(productionElement); return specializeElements; }
@Override protected void setContextElement( Element context, CompilationController controller ) { if ( context instanceof ExecutableElement ){ ExecutableElement method = (ExecutableElement) context; getShortElementName().append( context.getSimpleName().toString()); appendMethodParams(getShortElementName(), method); TypeElement enclosingType = controller.getElementUtilities(). enclosingTypeElement( context ); String typeFqn = enclosingType.getQualifiedName().toString(); getFqnElementName().append( typeFqn ); getFqnElementName().append('.'); getFqnElementName().append( context.getSimpleName().toString() ); appendMethodParams(getFqnElementName(), method); } else if ( context instanceof TypeElement ){ TypeElement type = (TypeElement) context; getShortElementName().append( type.getSimpleName().toString() ); getFqnElementName().append( type.getQualifiedName().toString() ); } }
private void update( List<VariableElement> vars , CompilationController controller) { DefaultMutableTreeNode root = new DefaultMutableTreeNode(); for (VariableElement var : vars) { FileObject fileObject = SourceUtils.getFile(ElementHandle .create(var), controller.getClasspathInfo()); InjectableTreeNode<Element> node = new InjectableTreeNode<Element>(fileObject, var, (DeclaredType)controller.getElementUtilities(). enclosingTypeElement(var).asType(), false,controller); root.add( node ); } setRoot(root); }
protected DeclaredType getParent( Element element , DeclaredType parentType) throws DefinitionError { DeclaredType parent = parentType; if ( parent == null ){ TypeElement type = getModel().getHelper().getCompilationController(). getElementUtilities().enclosingTypeElement(element); boolean isDeclaredType = ( type.asType() instanceof DeclaredType ); if ( isDeclaredType ){ parent = (DeclaredType)type.asType(); } else { throw new DefinitionError( type ); } } return parent; }
enclosingTypeElement(element); if ( !AnnotationUtil.isSessionBean( containingClass, compInfo) ){ return;
ElementHandle<Element> handleKey = ElementHandle.create( production ); TypeElement clazz = controller.getElementUtilities(). enclosingTypeElement(production); myProductionHandles.put(handleKey, ElementHandle.create( clazz ) ); productionMap.put( production, clazz );
enclosingTypeElement(resolve); parent = (DeclaredType)enclosingTypeElement.asType();
if (node.getTestcase().getName().endsWith(method.getSimpleName().toString())) { try { TypeElement enclosingTypeElement = compilationController.getElementUtilities().enclosingTypeElement(method); String originalPath = FileUtil.toFile(fo2open[0]).getAbsolutePath(); String elementFQP = element.toString().replaceAll("\\.", Matcher.quoteReplacement(File.separator)); //NOI18N
private void update( List<ExecutableElement> methods , CompilationController controller) { DefaultMutableTreeNode root = new DefaultMutableTreeNode(); Map<Element, InjectableTreeNode<? extends Element>> methodsMap= new LinkedHashMap<Element, InjectableTreeNode<? extends Element>>(); for (ExecutableElement method : methods) { FileObject fileObject = SourceUtils.getFile(ElementHandle .create(method), controller.getClasspathInfo()); MethodTreeNode node = new MethodTreeNode(fileObject, method, (DeclaredType)controller.getElementUtilities(). enclosingTypeElement(method).asType(), false, controller); insertTreeNode( methodsMap , method , node , root , controller); } setRoot(root); }
enclosingTypeElement( overridenMethod ); TypeElement containingClass = compInfo.getElementUtilities(). enclosingTypeElement( element ); TypeMirror typeDirectSuper = containingClass.getSuperclass(); if ( !superClass.equals(compInfo.getTypes().asElement(typeDirectSuper)) ||
private void findEnabledProductions(Set<Element> productions ) { /* * This is partial implementation of the spec : * A bean is said to be enabled if: * - it is not a producer method or field of a disabled bean * Full check for enabled/disabled bean is very complicated. * Here is check only for enabled alternatives if any. */ for (Iterator<Element> iterator = productions.iterator(); iterator.hasNext(); ) { Element element = iterator.next(); TypeElement enclosingTypeElement = getHelper(). getCompilationController().getElementUtilities(). enclosingTypeElement(element); if ( getResult().isAlternative(enclosingTypeElement)){ String name = enclosingTypeElement.getQualifiedName().toString(); if ( getResult().hasAlternative(enclosingTypeElement) ){ if ( !getModel().getAlternativeClasses().contains( name ) ){ iterator.remove(); } } if ( !alternativeStereotypesEnabled(enclosingTypeElement) ){ iterator.remove(); } } } }
if (method.getSimpleName().contentEquals(node.getTestcase().getName())) { try { TypeElement enclosingTypeElement = compilationController.getElementUtilities().enclosingTypeElement(method); String originalPath = FileUtil.toFile(fo2open[0]).getCanonicalPath(); String elementFQP = element.toString().replaceAll("\\.", Matcher.quoteReplacement(File.separator)); //NOI18N
enclosingTypeElement(method); TypeMirror superType = clazz.getSuperclass(); TypeElement superClass = compInfo.getElementUtilities(). enclosingTypeElement(overriddenMethod); if ( !superClass.equals( compInfo.getTypes().asElement( superType))){ return;
int index = triple.getThird(); TypeElement typeElement = getCompilationController(). getElementUtilities().enclosingTypeElement( method ); TypeMirror typeMirror = typeElement.asType(); if ( typeMirror instanceof DeclaredType ){
return isOfKindAndType(asMemberOf(e, t, types), e, kinds, baseType, scope, trees, types); TypeElement outer = eu.enclosingTypeElement(cls); cls = !cls.getModifiers().contains(STATIC) ? outer : null;
private void initDeclaredInterceptors() { final LinkedHashSet<TypeElement> result = new LinkedHashSet<TypeElement>(); AnnotationParser parser = AnnotationParser.create( getHelper()); parser.expectClassArray("value", new ArrayValueHandler() { @Override public Object handleArray( List<AnnotationValue> arrayMembers ) { for (AnnotationValue arrayMember : arrayMembers) { TypeMirror typeMirror = (TypeMirror) arrayMember.getValue(); Element element = getController().getTypes(). asElement( typeMirror ); if ( element instanceof TypeElement ){ result.add( (TypeElement)element ); } } return null; } }, null); Element subjectElement = getElement(); if ( subjectElement instanceof ExecutableElement ){ TypeElement enclosingType = getController().getElementUtilities(). enclosingTypeElement( subjectElement); fillDeclaredAnnotations(parser, enclosingType); } fillDeclaredAnnotations(parser, subjectElement); myDeclaredInterceptors = new ArrayList<TypeElement>( result ); }
@Override public Collection<AnnotationMirror> getInterceptorBindings( Element element ){ final InterceptorBindingChecker interceptorChecker = new InterceptorBindingChecker( getModel().getHelper() ); final StereotypeChecker stereotypeChecker = new StereotypeChecker( getModel().getHelper().getHelper()); TransitiveAnnotationHandler handler = new IntereptorBindingHandler( interceptorChecker, stereotypeChecker); Set<AnnotationMirror> result = new HashSet<AnnotationMirror>(); transitiveVisitAnnotatedElements(element, result, getModel().getHelper().getHelper(), handler); if ( element.getKind() == ElementKind.METHOD ){ TypeElement enclosedClass = getCompilationController(). getElementUtilities().enclosingTypeElement(element); Collection<AnnotationMirror> classBindings = getInterceptorBindings( enclosedClass ); result.addAll( classBindings ); } return result; }
getElementUtilities().enclosingTypeElement(element);
TypeElement enclosingTypeElement = controller.getElementUtilities(). enclosingTypeElement( method); String fqnMethodClass = enclosingTypeElement. getQualifiedName().toString();
Set<Element> productions = ((ResultImpl) result).getProductions(); TypeElement enclosingTypeElement = getCompilationController(). getElementUtilities().enclosingTypeElement(element); for (Iterator<Element> iterator = productions.iterator(); iterator.hasNext(); )