public Element resolveElement(CompilationInfo info) { return delegateElementHandle.resolveElement(info); }
public Element resolveElement(CompilationInfo info) { return parent.resolveElement(info); }
@Override public void run(CompilationController info) throws Exception { info.toPhase(JavaSource.Phase.RESOLVED); element[0] = treePathHandle.resolveElement(info); } }, true);
public void run(CompilationController parameter) throws Exception { parameter.toPhase(JavaSource.Phase.RESOLVED); Element element = handle.resolveElement(parameter); result.add(getTypeName( element , parameter )); } }, true);
public void run(CompilationController parameter) throws Exception { parameter.toPhase(JavaSource.Phase.RESOLVED); Element element = treePathHandle.resolveElement(parameter); // Fix for IZ159330 - NullPointerException at org.netbeans.modules.web.refactoring.WebRefactoringFactory$2.run if ( element == null ){ result[0] = null; } else { result[0] = element.asType().toString(); } } }, true);
@Override public void run(CompilationController controller) throws Exception { controller.toPhase(JavaSource.Phase.RESOLVED); Element el = tpHandle.resolveElement(controller); if (el != null) { switch(el.getKind()) { case FIELD: changeTypes[0] = RefactoringInfo.ChangeType.VARIABLE_RENAME; break; case LOCAL_VARIABLE: Element parentEl = el.getEnclosingElement(); if (parentEl.getKind() == ElementKind.METHOD && "initComponents".equals(parentEl.getSimpleName().toString()) // NOI18N && ((ExecutableElement)parentEl).getParameters().isEmpty()) { changeTypes[0] = RefactoringInfo.ChangeType.VARIABLE_RENAME; } break; } // [should we also check if it really matches an existing component in the form?] oldNames[0] = el.getSimpleName().toString(); } } }, true);
@Override public void run(CompilationController info) throws Exception { info.toPhase(JavaSource.Phase.RESOLVED); Element el = tph.resolveElement(info); if (el == null) { return; } if (el.getModifiers().contains(Modifier.PRIVATE)) { result[0] = null; } else { String refactoringWarning = getRefactoringWarning(); if (refactoringWarning != null) { result[0] = new Problem(false, refactoringWarning); } } }
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);
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 cc) throws Exception { cc.toPhase(Phase.RESOLVED); Element element = oldHandle.resolveElement(cc); if (element == null || element.getKind() != ElementKind.METHOD) { return; } PropertyType type = null; ExecutableElement ee = (ExecutableElement) element; if (JavaUtils.isGetter(ee)) { type = PropertyType.READ_ONLY; } else if (JavaUtils.isSetter(ee)) { type = PropertyType.WRITE_ONLY; } else { return; } // gather and keep all overridden methods plus current method Collection<ElementHandle<ExecutableElement>> methodHandles = JavaUtils.getOverridenMethodsAsHandles(ee, cc); methodHandles = new ArrayList<ElementHandle<ExecutableElement>>(methodHandles); methodHandles.add(ElementHandle.create(ee)); String oldName = JavaUtils.getPropertyName(element.getSimpleName().toString()); element = element.getEnclosingElement(); result[0] = new RenamedProperty(methodHandles, oldName, JavaUtils.getPropertyName(newName), type); } }, true);