| java.lang.Object org.netbeans.modules.refactoring.java.api.JavaRefactoringUtils
JavaRefactoringUtils | final public class JavaRefactoringUtils (Code) | | author: Tim Boudreau author: Jan Becicka |
Method Summary | |
public static void | cacheTreePathInfo(TreePath tp, CompilationInfo info) | public static List<ElementHandle<T>> | elementsToHandles(Iterable<? extends T> elements) | public static List<TypeMirror> | elementsToTypes(List<? extends Element> typeParams) | public static TreePath | findEnclosingClass(CompilationInfo javac, TreePath path, boolean isClass, boolean isInterface, boolean isEnum, boolean isAnnotation, boolean isAnonymous) Finds the nearest enclosing ClassTree on path that
is class or interface or enum or annotation type and is or is not annonymous. | public static ClasspathInfo | getClasspathInfoFor(FileObject... files) | public static Collection<TreePathHandle> | getInvocationsOf(ElementHandle e, CompilationController wc) | public static Collection<ExecutableElement> | getOverriddenMethods(ExecutableElement method, CompilationInfo info) | public static Collection<ExecutableElement> | getOverridingMethods(ExecutableElement method, CompilationInfo info) | public static Collection<TreePathHandle> | getReferencesToMember(ElementHandle<TypeElement> on, ClasspathInfo info, ElementHandle toFind) Get all of the references to the given member element (which may be part of another type) on
the passed element. | public static Collection<TypeElement> | getSuperTypes(TypeElement type, CompilationInfo info, boolean sourceOnly) Returns all supertypes of given type. | public static List<T> | handlesToElements(Iterable<ElementHandle<T>> handles, CompilationInfo info) | public static List<TypeMirror> | handlesToTypes(Iterable<? extends TypeMirrorHandle> types, CompilationInfo info) | public static boolean | isOnSourceClasspath(FileObject fo) Returns true if file is on known source path. | public static boolean | isRefactorable(FileObject file) | public static List<TreePathHandle> | treesToHandles(TreePath parent, Iterable<? extends Tree> trees, CompilationInfo info) | public static List<TreePathHandle> | treesToHandles(Iterable<? extends Tree> trees, CompilationInfo info) | public static List<TypeMirrorHandle> | typesToHandles(Iterable<? extends TypeMirror> types) |
cacheTreePathInfo | public static void cacheTreePathInfo(TreePath tp, CompilationInfo info)(Code) | | |
elementsToHandles | public static List<ElementHandle<T>> elementsToHandles(Iterable<? extends T> elements)(Code) | | Create ElementHandles from Elements
Parameters: elements - |
findEnclosingClass | public static TreePath findEnclosingClass(CompilationInfo javac, TreePath path, boolean isClass, boolean isInterface, boolean isEnum, boolean isAnnotation, boolean isAnonymous)(Code) | | Finds the nearest enclosing ClassTree on path that
is class or interface or enum or annotation type and is or is not annonymous.
In case no ClassTree is found the first top level ClassTree is returned.
Especially useful for selecting proper tree to refactor.
Parameters: javac - javac Parameters: path - path to search Parameters: isClass - stop on class Parameters: isInterface - stop on interface Parameters: isEnum - stop on enum Parameters: isAnnotation - stop on annotation type Parameters: isAnonymous - check if class or interface is annonymous path to the enclosing ClassTree |
getClasspathInfoFor | public static ClasspathInfo getClasspathInfoFor(FileObject... files)(Code) | | |
getReferencesToMember | public static Collection<TreePathHandle> getReferencesToMember(ElementHandle<TypeElement> on, ClasspathInfo info, ElementHandle toFind) throws IOException(Code) | | Get all of the references to the given member element (which may be part of another type) on
the passed element.
Parameters: on - A type which presumably refers to the passed element Parameters: toFind - An element, presumably a field or method, of some type (not necessarily the passed one) |
getSuperTypes | public static Collection<TypeElement> getSuperTypes(TypeElement type, CompilationInfo info, boolean sourceOnly)(Code) | | Returns all supertypes of given type.
Parameters: type - Parameters: info - Parameters: sourceOnly - library classes ignored if true |
handlesToElements | public static List<T> handlesToElements(Iterable<ElementHandle<T>> handles, CompilationInfo info)(Code) | | Resolves ElementHandles to Elemnts
Parameters: handles - Parameters: info - |
handlesToTypes | public static List<TypeMirror> handlesToTypes(Iterable<? extends TypeMirrorHandle> types, CompilationInfo info)(Code) | | Resolves TypeMirrorHandles to TypeMirrors
Parameters: types - Parameters: info - |
isOnSourceClasspath | public static boolean isOnSourceClasspath(FileObject fo)(Code) | | Returns true if file is on known source path.
Parameters: fo - |
isRefactorable | public static boolean isRefactorable(FileObject file)(Code) | | returns true if file's mime type is text/x-java and file is on know source path
Parameters: file - |
treesToHandles | public static List<TreePathHandle> treesToHandles(TreePath parent, Iterable<? extends Tree> trees, CompilationInfo info)(Code) | | |
treesToHandles | public static List<TreePathHandle> treesToHandles(Iterable<? extends Tree> trees, CompilationInfo info)(Code) | | Convert Trees to TreePathHandles
Parameters: trees - Parameters: info - |
typesToHandles | public static List<TypeMirrorHandle> typesToHandles(Iterable<? extends TypeMirror> types)(Code) | | Creates TypeMirrosHandles from TypeMirrors
Parameters: types - |
|
|