Class BinaryTypeFactory
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.java.model.BinaryTypeFactory
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IBinaryType
create(IOrdinaryClassFile classFile, org.eclipse.core.runtime.IProgressMonitor monitor)
static BinaryTypeDescriptor
createDescriptor(IClassFile classFile)
static char[]
fieldDescriptorToBinaryName(char[] fieldDescriptor)
Given a field descriptor, if the field descriptor points to a class this returns the binary name of the class.static org.eclipse.core.runtime.IPath
Returns the absolute filesystem location of the given element or the empty path if nonestatic ClassFileReader
rawReadType(BinaryTypeDescriptor descriptor, boolean fullyInitialize)
static ClassFileReader
rawReadTypeTestForExists(BinaryTypeDescriptor descriptor, boolean fullyInitialize, boolean useInvalidArchiveCache)
Read the class file from disk, circumventing the index's cache.static IBinaryType
readType(BinaryTypeDescriptor descriptor, org.eclipse.core.runtime.IProgressMonitor monitor)
Reads the given binary type.
-
Constructor Details
-
BinaryTypeFactory
public BinaryTypeFactory()
-
-
Method Details
-
createDescriptor
-
create
public static IBinaryType create(IOrdinaryClassFile classFile, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException, ClassFormatException -
readType
public static IBinaryType readType(BinaryTypeDescriptor descriptor, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException, ClassFormatExceptionReads the given binary type. If the type can be found in the index with a fingerprint that exactly matches the file on disk, the type is read from the index. Otherwise the type is read from disk. Returns null if no such type exists. -
rawReadType
public static ClassFileReader rawReadType(BinaryTypeDescriptor descriptor, boolean fullyInitialize) throws JavaModelException, ClassFormatException -
rawReadTypeTestForExists
public static ClassFileReader rawReadTypeTestForExists(BinaryTypeDescriptor descriptor, boolean fullyInitialize, boolean useInvalidArchiveCache) throws JavaModelException, ClassFormatException, FileNotFoundExceptionRead the class file from disk, circumventing the index's cache. This should only be used by callers that need to read information from the class file which aren't present in the index (such as method bodies).- Returns:
- the newly-created ClassFileReader or null if the given class file does not exist.
- Throws:
ClassFormatException
- if the class file existed but was corruptJavaModelException
- if unable to read the class file due to a transient failureFileNotFoundException
- if the file does not exist
-
getLocationForElement
Returns the absolute filesystem location of the given element or the empty path if noneThe logic used in
getLocationForElement(IJavaElement)
andJavaModelManager.getLocalFile(IPath)
should be equivalent. -
fieldDescriptorToBinaryName
public static char[] fieldDescriptorToBinaryName(char[] fieldDescriptor)Given a field descriptor, if the field descriptor points to a class this returns the binary name of the class. If the field descriptor points to any other type, this returns the empty string. The field descriptor may optionally contain a trailing ';'.- Parameters:
fieldDescriptor
-- Returns:
- ""
-