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 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 }
public JavaClassNode(ClasspathInfo cpInfo, boolean isAnonymous, TypeElement type, ContainerNode parent) { this(cpInfo, getSimpleName(ElementUtilities.getBinaryName(type)), isAnonymous, type, parent); }
private String getSuperTypeClassName(TypeElement classElement, CompilationInfo ci) { String superClassName = null; TypeMirror superclass = classElement.getSuperclass(); if (superclass != null) { Element superclassElement = ci.getTypes().asElement(superclass); if ((superclassElement != null) && (superclassElement.getKind() == ElementKind.CLASS)) { String superclassName = ElementUtilities.getBinaryName((TypeElement) superclassElement); if (!superclassName.equals("java.lang.Object")) { superClassName = superclassName; } } } return superClassName; }
private String getInterfaceNames(TypeElement classElement, CompilationInfo ci) { String ifcNames = null; List<? extends TypeMirror> ifcs = classElement.getInterfaces(); if (ifcs != null) { StringBuilder sb = new StringBuilder(); boolean firstRun = true; for (TypeMirror ifc : ifcs) { Element superclassElement = ci.getTypes().asElement(ifc); if ((superclassElement != null) && (superclassElement.getKind() == ElementKind.INTERFACE)) { if (!firstRun) { sb.append(", "); } sb.append(ElementUtilities.getBinaryName((TypeElement) superclassElement)); } } ifcNames = sb.toString(); } return ifcNames; }
private static String getTypeBinaryName(TypeMirror t) { if (t instanceof ArrayType) { TypeMirror ct = ((ArrayType) t).getComponentType(); return getTypeBinaryName(ct)+"[]"; } if (t instanceof DeclaredType) { return ElementUtilities.getBinaryName((TypeElement) ((DeclaredType) t).asElement()); } return t.toString(); }
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 void run(CompilationController cc) throws IOException { cc.toPhase(Phase.ELEMENTS_RESOLVED); for (TypeElement typeElement : cc.getTopLevelElements()) { result.add(ElementUtilities.getBinaryName(typeElement)); } } }, true);
@Override public TypeElement visitType(TypeElement typeElement, String binaryName) { String bName = ElementUtilities.getBinaryName(typeElement); if(binaryName.equals(bName)) { return typeElement; } else if(binaryName.startsWith(bName)) { for(Element child : typeElement.getEnclosedElements()) { if(!child.getKind().isClass()) { continue; } TypeElement retVal = child.accept(this, binaryName); if(retVal != null) { return retVal; } } } return null; } }
public void run(CompilationController cc) throws IOException { cc.toPhase(Phase.RESOLVED); Element element = oldHandle.resolveElement(cc); if (element == null || element.getKind() != ElementKind.CLASS) { return; } String oldBinaryName = ElementUtilities.getBinaryName((TypeElement)element); String oldSimpleName = element.getSimpleName().toString(); String newBinaryName = null; element = element.getEnclosingElement(); if (element.getKind() == ElementKind.CLASS) { newBinaryName = ElementUtilities.getBinaryName((TypeElement)element) + '$' + newName; } else if (element.getKind() == ElementKind.PACKAGE) { String packageName = ((PackageElement)element).getQualifiedName().toString(); newBinaryName = createQualifiedName(packageName, newName); } else { LOGGER.log(Level.WARNING, "Enclosing element of {0} was neither class nor package", oldHandle); } result[0] = new RenamedClassName(oldSimpleName, oldBinaryName, newBinaryName); } }, true);
public void run(CompilationController compilationController) throws Exception { compilationController.toPhase(JavaSource.Phase.RESOLVED); TypeElement type = (TypeElement) treePathHandle.resolveElement(compilationController); if (type != null) { className[0] = ElementUtilities.getBinaryName(type); } } }, true);
@Override public void run(CompilationController controller) throws Exception { controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); if (implClass == null) { return; } TypeElement te = JavaUtils.findClassElementByBinaryName(implClass, controller); if (te == null) { return; } FactoryMethodFinder factoryMethodFinder = new FactoryMethodFinder( te, factoryMethodName, staticFlag, controller.getElementUtilities()); List<ExecutableElement> methods = factoryMethodFinder.findMethods(); if (methods.size() != 1) { return; } ExecutableElement method = methods.get(0); if (method.getReturnType().getKind() != TypeKind.DECLARED) { return; } wasClassResolved.set(true); DeclaredType dt = (DeclaredType) method.getReturnType(); resolvedClass[0] = ElementUtilities.getBinaryName((TypeElement) dt.asElement()); }
signature = new SourceCodeSelection(ElementUtilities.getBinaryName(getEnclosingClass(method)), method.getSimpleName().toString(), signatureString[0]); updateDisplayName(formatterFactory.getFormatter().formatMethodName(signature).toFormatted());
currentMethodPtr[2] = ElementUtilities.getBinaryName(te);
if (ElementUtilities.getBinaryName(te).startsWith(typedPrefix)) { SpringXMLConfigCompletionItem item = SpringXMLConfigCompletionItem.createTypeItem(substitutionOffset, te, ElementHandle.create(te), cc.getElements().isDeprecated(te), false);
if (cFileObject != null) { root = cFileObject; for (String pathElement : ElementUtilities.getBinaryName(clazz).split("\\.")) { root = root.getParent();
@Override public final boolean refresh(TypeElement type) { Map<String, ? extends AnnotationMirror> types = getHelper().getAnnotationsByType( getHelper().getCompilationController().getElements().getAllAnnotationMirrors(type)); AnnotationMirror annotationMirror = getAnnotationMirror(types); if (annotationMirror == null) { return false; } AnnotationParser parser = AnnotationParser.create(getHelper()); parser.expectString("value", null); //NOI18N ParseResult parseResult = parser.parse(annotationMirror); className = ElementUtilities.getBinaryName(type); names.clear(); if (parseResult.get("value", String.class) == null) { //NOI18N names.add(getConvertedClassName(className)); } else { names.add(parseResult.get("value", String.class)); //NOI18N } refreshLocation(className); return true; }
String fqn = ElementUtilities.getBinaryName(typeElement); String className = fqn.substring(packageName.length()); if ( className.length() >0 && className.charAt(0)=='.' ){
currentClassPtr[0] = ElementUtilities.getBinaryName((TypeElement) el);
result[0] = ElementUtilities.getBinaryName(te); } else { ErrorManager.getDefault().log(ErrorManager.WARNING,