|
||||||||||
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[] |
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(java.io.File file)
|
static ClassFileReader |
read(java.io.File file,
boolean fullyInitialize)
|
static ClassFileReader |
read(java.io.InputStream stream,
java.lang.String fileName)
|
static ClassFileReader |
read(java.io.InputStream stream,
java.lang.String fileName,
boolean fullyInitialize)
|
static ClassFileReader |
read(java.lang.String fileName)
|
static ClassFileReader |
read(java.lang.String fileName,
boolean fullyInitialize)
|
static ClassFileReader |
read(java.util.zip.ZipFile zip,
java.lang.String filename)
|
static ClassFileReader |
read(java.util.zip.ZipFile zip,
java.lang.String filename,
boolean fullyInitialize)
|
char[] |
sourceFileName()
Answer the source file name attribute. |
java.lang.String |
toString()
|
Methods inherited from class org.eclipse.jdt.internal.compiler.classfmt.ClassFileStruct |
---|
doubleAt, floatAt, i4At, i8At, u1At, u2At, u4At, utf8At |
Methods inherited from class java.lang.Object |
---|
equals, 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(java.io.File file) throws ClassFormatException, java.io.IOException
ClassFormatException
java.io.IOException
public static ClassFileReader read(java.io.File file, boolean fullyInitialize) throws ClassFormatException, java.io.IOException
ClassFormatException
java.io.IOException
public static ClassFileReader read(java.io.InputStream stream, java.lang.String fileName) throws ClassFormatException, java.io.IOException
ClassFormatException
java.io.IOException
public static ClassFileReader read(java.io.InputStream stream, java.lang.String fileName, boolean fullyInitialize) throws ClassFormatException, java.io.IOException
ClassFormatException
java.io.IOException
public static ClassFileReader read(java.util.zip.ZipFile zip, java.lang.String filename) throws ClassFormatException, java.io.IOException
ClassFormatException
java.io.IOException
public static ClassFileReader read(java.util.zip.ZipFile zip, java.lang.String filename, boolean fullyInitialize) throws ClassFormatException, java.io.IOException
ClassFormatException
java.io.IOException
public static ClassFileReader read(java.lang.String fileName) throws ClassFormatException, java.io.IOException
ClassFormatException
java.io.IOException
public static ClassFileReader read(java.lang.String fileName, boolean fullyInitialize) throws ClassFormatException, java.io.IOException
ClassFormatException
java.io.IOException
public int accessFlags()
public IBinaryAnnotation[] getAnnotations()
IBinaryType
getAnnotations
in interface IBinaryType
public int[] getConstantPoolOffsets()
public char[] getEnclosingTypeName()
IBinaryType
getEnclosingTypeName
in interface IBinaryType
public IBinaryField[] getFields()
getFields
in interface IBinaryType
public char[] getFileName()
IDependent
getFileName
in interface IDependent
IDependent.getFileName()
public char[] getGenericSignature()
IBinaryType
getGenericSignature
in interface IBinaryType
public char[] getInnerSourceName()
public char[][] getInterfaceNames()
getInterfaceNames
in interface IBinaryType
public IBinaryNestedType[] getMemberTypes()
getMemberTypes
in interface IBinaryType
public IBinaryMethod[] getMethods()
getMethods
in interface IBinaryType
public char[][][] getMissingTypeNames()
IBinaryType
getMissingTypeNames
in interface IBinaryType
public int getModifiers()
getModifiers
in interface IGenericType
public char[] getName()
getName
in interface IBinaryType
public char[] getSourceName()
IBinaryType
getSourceName
in interface IBinaryType
public char[] getSuperclassName()
getSuperclassName
in interface IBinaryType
public long getTagBits()
IBinaryType
getTagBits
in interface IBinaryType
public 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 IBinaryType
boolean
public boolean isBinaryType()
isBinaryType
in interface IGenericType
public boolean isLocal()
isLocal
in interface IBinaryType
boolean
public boolean isMember()
isMember
in interface IBinaryType
boolean
public boolean isNestedType()
boolean
public char[] sourceFileName()
sourceFileName
in interface IBinaryType
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |