| java.lang.Object de.loskutov.bco.ui.JdtUtils
JdtUtils | public class JdtUtils (Code) | | author: Andrei |
Inner Class :static class SourceOffsetComparator implements Comparator | |
Inner Class :static class AnonymClassComparator implements Comparator | |
Method Summary | |
public static InputStream | createInputStream(IJavaElement javaElement) | public static String | createMethodSignature(IMethod iMethod) | static int | getAnonCompilePriority(IJavaElement javaElement, IJavaElement firstAncestor, IJavaElement topAncestor, boolean is50OrHigher) 1) from instance init 2) from deepest inner from instance init (deepest first) 3) from
static init 4) from deepest inner from static init (deepest first) 5) from deepest inner
(deepest first) 6) regular anon classes from main class
Note, that nested inner anon. | public static String | getByteCodePath(IJavaElement javaElement) | public static ClassLoader | getClassLoader(IJavaElement type) | public static IJavaElement | getElementAtOffset(IJavaElement input, ITextSelection selection) | public static String | getElementName(IJavaElement javaElement) Cite: jdk1.1.8/docs/guide/innerclasses/spec/innerclasses.doc10.html: For the sake
of tools, there are some additional requirements on the naming of an inaccessible
class N. | public static IType | getEnclosingType(IJavaElement childEl) | static IType | getFirstAncestor(IJavaElement javaElement) | static IJavaElement | getFirstNonAnonymous(IJavaElement javaElement, IJavaElement topAncestor) | public static String | getFullBytecodeName(IClassFile classFile) | public static IClassFile | getInnerType(IClassFile cf, DecompiledClass dc, String typeSignature) | static IJavaElement | getLastAncestor(IJavaElement javaElement, int elementType) | public static IJavaElement | getMethod(IParent parent, String signature) | public static String | getMethodSignature(IJavaElement childEl) | static int | getTopAncestorDistance(IJavaElement javaElement, IJavaElement topAncestor) | public static boolean | is50OrHigher(IJavaElement javaElt) Modified copy from JavaModelUtil. | public static boolean | isAbstractOrInterface(IJavaElement javaEl) Check if java element is an interface or abstract method or a method from
interface. |
createInputStream | public static InputStream createInputStream(IJavaElement javaElement)(Code) | | Parameters: javaElement - new generated input stream for given element bytecode class file, or nullif class file cannot be found or this element is not from java source path |
createMethodSignature | public static String createMethodSignature(IMethod iMethod) throws JavaModelException(Code) | | |
getAnonCompilePriority | static int getAnonCompilePriority(IJavaElement javaElement, IJavaElement firstAncestor, IJavaElement topAncestor, boolean is50OrHigher)(Code) | | 1) from instance init 2) from deepest inner from instance init (deepest first) 3) from
static init 4) from deepest inner from static init (deepest first) 5) from deepest inner
(deepest first) 6) regular anon classes from main class
Note, that nested inner anon. classes which do not have different non-anon. inner class
ancestors, are compiled in they nesting order, opposite to rule 2)
Parameters: javaElement - priority - lesser mean wil be compiled later, a value > 0 throws: JavaModelException - |
getByteCodePath | public static String getByteCodePath(IJavaElement javaElement)(Code) | | Works only for eclipse - managed/generated bytecode, ergo not with imported
classes/jars
Parameters: javaElement - full os-specific file path to .class resource, containing given element |
getClassLoader | public static ClassLoader getClassLoader(IJavaElement type)(Code) | | Parameters: type - |
getElementAtOffset | public static IJavaElement getElementAtOffset(IJavaElement input, ITextSelection selection) throws JavaModelException(Code) | | Modified copy from org.eclipse.jdt.internal.ui.actions.SelectionConverter
Parameters: input - Parameters: selection - null, if selection is null or could not be resolved to java element throws: JavaModelException - |
getElementName | public static String getElementName(IJavaElement javaElement)(Code) | | Cite: jdk1.1.8/docs/guide/innerclasses/spec/innerclasses.doc10.html: For the sake
of tools, there are some additional requirements on the naming of an inaccessible
class N. Its bytecode name must consist of the bytecode name of an enclosing class
(the immediately enclosing class, if it is a member), followed either by `$' and a
positive decimal numeral chosen by the compiler, or by `$' and the simple name of
N, or else by both (in that order). Moreover, the bytecode name of a block-local N
must consist of its enclosing package member T, the characters `$1$', and N, if the
resulting name would be unique.
Note, that this rule was changed for static blocks after 1.5 jdk.
Parameters: javaElement - simply element name |
getEnclosingType | public static IType getEnclosingType(IJavaElement childEl)(Code) | | Parameters: childEl - may be null first ancestor with IJavaElement.TYPE element type, or null |
getFirstAncestor | static IType getFirstAncestor(IJavaElement javaElement)(Code) | | Parameters: javaElement - null, if javaElement is top level class |
getFirstNonAnonymous | static IJavaElement getFirstNonAnonymous(IJavaElement javaElement, IJavaElement topAncestor)(Code) | | Parameters: javaElement - first non-anonymous ancestor |
getFullBytecodeName | public static String getFullBytecodeName(IClassFile classFile)(Code) | | Parameters: classFile - full qualified bytecode name of given class |
getInnerType | public static IClassFile getInnerType(IClassFile cf, DecompiledClass dc, String typeSignature)(Code) | | Parameters: cf - Parameters: dc - inner type which has the same name as the given string, or null |
getLastAncestor | static IJavaElement getLastAncestor(IJavaElement javaElement, int elementType)(Code) | | |
getMethod | public static IJavaElement getMethod(IParent parent, String signature)(Code) | | |
getMethodSignature | public static String getMethodSignature(IJavaElement childEl)(Code) | | Parameters: childEl - method signature, if given java element is either initializer or method,otherwise returns null. |
getTopAncestorDistance | static int getTopAncestorDistance(IJavaElement javaElement, IJavaElement topAncestor)(Code) | | Parameters: javaElement - distance to given ancestor, 0 if it is the same, -1 if ancestor with typeIJavaElement.TYPE does not exist |
is50OrHigher | public static boolean is50OrHigher(IJavaElement javaElt)(Code) | | Modified copy from JavaModelUtil.
Parameters: javaElt - true, if corresponding java project has compiler setting to generatebytecode for jdk 1.5 and above |
isAbstractOrInterface | public static boolean isAbstractOrInterface(IJavaElement javaEl)(Code) | | Check if java element is an interface or abstract method or a method from
interface.
|
|
|