|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jdt.internal.compiler.classfmt.ClassFileStruct
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader
public class ClassFileReader
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.jdt.internal.compiler.env.IBinaryType |
|---|
NoField, NoInterface, NoMethod, NoNestedType |
| Fields inherited from interface org.eclipse.jdt.internal.compiler.env.IDependent |
|---|
JAR_FILE_ENTRY_SEPARATOR |
| Constructor Summary | |
|---|---|
ClassFileReader(byte[] classFileBytes,
char[] fileName)
|
|
ClassFileReader(byte[] classFileBytes,
char[] fileName,
boolean fullyInitialize)
|
|
| Method Summary | |
|---|---|
int |
accessFlags()
Answer the receiver's access flags. |
IBinaryAnnotation[] |
getAnnotations()
Answer the runtime visible and invisible annotations for this type or null if none. |
int[] |
getConstantPoolOffsets()
Answer the int array that corresponds to all the offsets of each entry in the constant pool |
char[] |
getEnclosingMethod()
Answer the enclosing method (including method selector and method descriptor), or null if none. |
char[] |
getEnclosingTypeName()
Answer the resolved name of the enclosing type in the class file format as specified in section 4.2 of the Java 2 VM spec or null if the receiver is a top level type. |
IBinaryField[] |
getFields()
Answer the receiver's this.fields or null if the array is empty. |
char[] |
getFileName()
Answer the file name which defines the type. |
char[] |
getGenericSignature()
Answer the receiver's signature which describes the parameter & return types as specified in section 4.4.4 of the Java 2 VM spec 3rd edition. |
char[] |
getInnerSourceName()
Answer the source name if the receiver is a inner type. |
char[][] |
getInterfaceNames()
Answer the resolved names of the receiver's interfaces in the class file format as specified in section 4.2 of the Java 2 VM spec or null if the array is empty. |
IBinaryNestedType[] |
getMemberTypes()
Answer the receiver's nested types or null if the array is empty. |
IBinaryMethod[] |
getMethods()
Answer the receiver's this.methods or null if the array is empty. |
char[][][] |
getMissingTypeNames()
Answer the list of missing type names which were referenced from the problem classfile. |
int |
getModifiers()
Answer an int whose bits are set according the access constants defined by the VM spec. |
char[] |
getName()
Answer the resolved name of the type in the class file format as specified in section 4.2 of the Java 2 VM spec. |
char[] |
getSourceName()
Answer the simple name of the type in the class file. |
char[] |
getSuperclassName()
Answer the resolved name of the receiver's superclass in the class file format as specified in section 4.2 of the Java 2 VM spec or null if it does not have one. |
long |
getTagBits()
Answer the tagbits set according to the bits for annotations. |
long |
getVersion()
Answer the major/minor version defined in this class file according to the VM spec. |
boolean |
hasStructuralChanges(byte[] newBytes)
Check if the receiver has structural changes compare to the byte array in argument. |
boolean |
hasStructuralChanges(byte[] newBytes,
boolean orderRequired,
boolean excludesSynthetic)
Check if the receiver has structural changes compare to the byte array in argument. |
boolean |
isAnonymous()
Answer true if the receiver is an anonymous type, false otherwise |
boolean |
isBinaryType()
Answer whether the receiver contains the resolved binary form or the unresolved source form of the type. |
boolean |
isLocal()
Answer true if the receiver is a local type, false otherwise |
boolean |
isMember()
Answer true if the receiver is a member type, false otherwise |
boolean |
isNestedType()
Answer true if the receiver is a nested type, false otherwise |
static ClassFileReader |
read(File file)
|
static ClassFileReader |
read(File file,
boolean fullyInitialize)
|
static ClassFileReader |
read(InputStream stream,
String fileName)
|
static ClassFileReader |
read(InputStream stream,
String fileName,
boolean fullyInitialize)
|
static ClassFileReader |
read(String fileName)
|
static ClassFileReader |
read(String fileName,
boolean fullyInitialize)
|
static ClassFileReader |
read(ZipFile zip,
String filename)
|
static ClassFileReader |
read(ZipFile zip,
String filename,
boolean fullyInitialize)
|
char[] |
sourceFileName()
Answer the source file name attribute. |
String |
toString()
|
| Methods inherited from class org.eclipse.jdt.internal.compiler.classfmt.ClassFileStruct |
|---|
doubleAt, floatAt, i4At, i8At, reset, u1At, u2At, u4At, utf8At |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ClassFileReader(byte[] classFileBytes,
char[] fileName)
throws ClassFormatException
classFileBytes - Actual bytes of a .class filefileName - Actual name of the file that contains the bytes, can be null
ClassFormatException
public ClassFileReader(byte[] classFileBytes,
char[] fileName,
boolean fullyInitialize)
throws ClassFormatException
classFileBytes - byte[]
Actual bytes of a .class filefileName - char[]
Actual name of the file that contains the bytes, can be nullfullyInitialize - boolean
Flag to fully initialize the new object
ClassFormatException| Method Detail |
|---|
public static ClassFileReader read(File file)
throws ClassFormatException,
IOException
ClassFormatException
IOException
public static ClassFileReader read(File file,
boolean fullyInitialize)
throws ClassFormatException,
IOException
ClassFormatException
IOException
public static ClassFileReader read(InputStream stream,
String fileName)
throws ClassFormatException,
IOException
ClassFormatException
IOException
public static ClassFileReader read(InputStream stream,
String fileName,
boolean fullyInitialize)
throws ClassFormatException,
IOException
ClassFormatException
IOException
public static ClassFileReader read(ZipFile zip,
String filename)
throws ClassFormatException,
IOException
ClassFormatException
IOException
public static ClassFileReader read(ZipFile zip,
String filename,
boolean fullyInitialize)
throws ClassFormatException,
IOException
ClassFormatException
IOException
public static ClassFileReader read(String fileName)
throws ClassFormatException,
IOException
ClassFormatException
IOException
public static ClassFileReader read(String fileName,
boolean fullyInitialize)
throws ClassFormatException,
IOException
ClassFormatException
IOExceptionpublic int accessFlags()
public IBinaryAnnotation[] getAnnotations()
IBinaryType
getAnnotations in interface IBinaryTypepublic int[] getConstantPoolOffsets()
public char[] getEnclosingMethod()
IBinaryType
getEnclosingMethod in interface IBinaryTypepublic char[] getEnclosingTypeName()
IBinaryType
getEnclosingTypeName in interface IBinaryTypepublic IBinaryField[] getFields()
getFields in interface IBinaryTypepublic char[] getFileName()
IDependent
getFileName in interface IDependentIDependent.getFileName()public char[] getGenericSignature()
IBinaryType
getGenericSignature in interface IBinaryTypepublic char[] getInnerSourceName()
public char[][] getInterfaceNames()
getInterfaceNames in interface IBinaryTypepublic IBinaryNestedType[] getMemberTypes()
getMemberTypes in interface IBinaryTypepublic IBinaryMethod[] getMethods()
getMethods in interface IBinaryTypepublic char[][][] getMissingTypeNames()
IBinaryType
getMissingTypeNames in interface IBinaryTypepublic int getModifiers()
getModifiers in interface IGenericTypepublic char[] getName()
getName in interface IBinaryTypepublic char[] getSourceName()
IBinaryType
getSourceName in interface IBinaryTypepublic char[] getSuperclassName()
getSuperclassName in interface IBinaryTypepublic long getTagBits()
IBinaryType
getTagBits in interface IBinaryTypepublic long getVersion()
public boolean hasStructuralChanges(byte[] newBytes)
newBytes - the bytes of the .class file we want to compare the receiver to
public boolean hasStructuralChanges(byte[] newBytes,
boolean orderRequired,
boolean excludesSynthetic)
newBytes - the bytes of the .class file we want to compare the receiver toorderRequired - a boolean indicating whether the members should be sorted or notexcludesSynthetic - a boolean indicating whether the synthetic members should be used in the comparison
public boolean isAnonymous()
isAnonymous in interface IBinaryTypebooleanpublic boolean isBinaryType()
isBinaryType in interface IGenericTypepublic boolean isLocal()
isLocal in interface IBinaryTypebooleanpublic boolean isMember()
isMember in interface IBinaryTypebooleanpublic boolean isNestedType()
booleanpublic char[] sourceFileName()
sourceFileName in interface IBinaryTypepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||