org.aspectj.org.eclipse.jdt.internal.core.util
Class ClassFileReader

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileStruct
      extended by org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileReader
All Implemented Interfaces:
IClassFileReader

public class ClassFileReader
extends ClassFileStruct
implements IClassFileReader


Field Summary
 
Fields inherited from interface org.aspectj.org.eclipse.jdt.core.util.IClassFileReader
ALL, ALL_BUT_METHOD_BODIES, CLASSFILE_ATTRIBUTES, CONSTANT_POOL, FIELD_INFOS, METHOD_BODIES, METHOD_INFOS, SUPER_INTERFACES
 
Constructor Summary
ClassFileReader(byte[] classFileBytes, int decodingFlags)
          Constructor for ClassFileReader.
 
Method Summary
 int getAccessFlags()
          Answer back the access flag of the .class file.
 int getAttributeCount()
          Answer back the attribute number of the .class file.
 IClassFileAttribute[] getAttributes()
          Answer back the collection of all attributes of the field info.
 int getClassIndex()
          Answer back the index of the class name in the constant pool of the .class file.
 char[] getClassName()
          Answer back the qualified name of the .class file.
 IConstantPool getConstantPool()
          Answer the constant pool of this .class file.
 IFieldInfo[] getFieldInfos()
          Answer back the array of field infos of the .class file, an empty array if none.
 int getFieldsCount()
          Answer back the number of field infos.
 IInnerClassesAttribute getInnerClassesAttribute()
          Answer back the inner classes attribute of this .class file, null if none.
 int[] getInterfaceIndexes()
          Answer back the indexes in the constant pool of interfaces implemented by this .class file, an empty array if none.
 char[][] getInterfaceNames()
          Answer back the names of interfaces implemented by this .class file, an empty array if none.
 int getMagic()
          Answer back the magic number.
 int getMajorVersion()
          Answer the major version of this .class file.
 IMethodInfo[] getMethodInfos()
          Answer back the array of method infos of this .class file, an empty array if none.
 int getMethodsCount()
          Answer back the number of method infos.
 int getMinorVersion()
          Answer the minor version of this .class file.
 ISourceAttribute getSourceFileAttribute()
          Answer the source file attribute, if it exists, null otherwise.
 int getSuperclassIndex()
          Answer back the index of the superclass name in the constant pool of the .class file.
 char[] getSuperclassName()
          Answer back the qualified name of the superclass of this .class file.
 boolean isClass()
          Answer true if this .class file represents an class, false otherwise.
 boolean isInterface()
          Answer true if this .class file represents an interface, false otherwise.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileStruct
doubleAt, floatAt, i1At, i2At, i4At, i8At, u1At, u2At, u4At, utf8At
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFileReader

public ClassFileReader(byte[] classFileBytes,
                       int decodingFlags)
                throws ClassFormatException
Constructor for ClassFileReader.

Parameters:
classFileBytes - the raw bytes of the .class file
decodingFlags - the decoding flags
Throws:
ClassFormatException
See Also:
IClassFileReader.ALL, IClassFileReader.CLASSFILE_ATTRIBUTES, IClassFileReader.CONSTANT_POOL, IClassFileReader.FIELD_INFOS
Method Detail

getAccessFlags

public int getAccessFlags()
Description copied from interface: IClassFileReader
Answer back the access flag of the .class file.

Specified by:
getAccessFlags in interface IClassFileReader
Returns:
the access flag of the .class file
See Also:
IClassFileReader.getAccessFlags()

getAttributeCount

public int getAttributeCount()
Description copied from interface: IClassFileReader
Answer back the attribute number of the .class file.

Specified by:
getAttributeCount in interface IClassFileReader
Returns:
the attribute number of the .class file
See Also:
IClassFileReader.getAttributeCount()

getAttributes

public IClassFileAttribute[] getAttributes()
Description copied from interface: IClassFileReader
Answer back the collection of all attributes of the field info. It includes SyntheticAttribute, ConstantValueAttributes, etc. Answers an empty array if none.

Specified by:
getAttributes in interface IClassFileReader
Returns:
the collection of all attributes of the field info. It includes SyntheticAttribute, ConstantValueAttributes, etc. Answers an empty array if none
See Also:
IClassFileReader.getAttributes()

getClassIndex

public int getClassIndex()
Description copied from interface: IClassFileReader
Answer back the index of the class name in the constant pool of the .class file.

Specified by:
getClassIndex in interface IClassFileReader
Returns:
the index of the class name in the constant pool
See Also:
IClassFileReader.getClassIndex()

getClassName

public char[] getClassName()
Description copied from interface: IClassFileReader
Answer back the qualified name of the .class file. The name is returned as described in the JVM specifications.

Specified by:
getClassName in interface IClassFileReader
Returns:
the qualified name of the .class file
See Also:
IClassFileReader.getClassName()

getConstantPool

public IConstantPool getConstantPool()
Description copied from interface: IClassFileReader
Answer the constant pool of this .class file.

Specified by:
getConstantPool in interface IClassFileReader
Returns:
the constant pool of this .class file
See Also:
IClassFileReader.getConstantPool()

getFieldInfos

public IFieldInfo[] getFieldInfos()
Description copied from interface: IClassFileReader
Answer back the array of field infos of the .class file, an empty array if none.

Specified by:
getFieldInfos in interface IClassFileReader
Returns:
the array of field infos of the .class file, an empty array if none
See Also:
IClassFileReader.getFieldInfos()

getFieldsCount

public int getFieldsCount()
Description copied from interface: IClassFileReader
Answer back the number of field infos.

Specified by:
getFieldsCount in interface IClassFileReader
Returns:
the number of field infos
See Also:
IClassFileReader.getFieldsCount()

getInnerClassesAttribute

public IInnerClassesAttribute getInnerClassesAttribute()
Description copied from interface: IClassFileReader
Answer back the inner classes attribute of this .class file, null if none.

Specified by:
getInnerClassesAttribute in interface IClassFileReader
Returns:
the inner classes attribute of this .class file, null if none
See Also:
IClassFileReader.getInnerClassesAttribute()

getInterfaceIndexes

public int[] getInterfaceIndexes()
Description copied from interface: IClassFileReader
Answer back the indexes in the constant pool of interfaces implemented by this .class file, an empty array if none.

Specified by:
getInterfaceIndexes in interface IClassFileReader
Returns:
the indexes in the constant pool of interfaces implemented by this .class file, an empty array if none
See Also:
IClassFileReader.getInterfaceIndexes()

getInterfaceNames

public char[][] getInterfaceNames()
Description copied from interface: IClassFileReader
Answer back the names of interfaces implemented by this .class file, an empty array if none. The names are returned as described in the JVM specifications.

Specified by:
getInterfaceNames in interface IClassFileReader
Returns:
the names of interfaces implemented by this .class file, an empty array if none
See Also:
IClassFileReader.getInterfaceNames()

getMagic

public int getMagic()
Description copied from interface: IClassFileReader
Answer back the magic number.

Specified by:
getMagic in interface IClassFileReader
Returns:
the magic number
See Also:
IClassFileReader.getMagic()

getMajorVersion

public int getMajorVersion()
Description copied from interface: IClassFileReader
Answer the major version of this .class file.

Specified by:
getMajorVersion in interface IClassFileReader
Returns:
the major version of this .class file
See Also:
IClassFileReader.getMajorVersion()

getMethodInfos

public IMethodInfo[] getMethodInfos()
Description copied from interface: IClassFileReader
Answer back the array of method infos of this .class file, an empty array if none.

Specified by:
getMethodInfos in interface IClassFileReader
Returns:
the array of method infos of this .class file, an empty array if none
See Also:
IClassFileReader.getMethodInfos()

getMethodsCount

public int getMethodsCount()
Description copied from interface: IClassFileReader
Answer back the number of method infos.

Specified by:
getMethodsCount in interface IClassFileReader
Returns:
the number of method infos
See Also:
IClassFileReader.getMethodsCount()

getMinorVersion

public int getMinorVersion()
Description copied from interface: IClassFileReader
Answer the minor version of this .class file.

Specified by:
getMinorVersion in interface IClassFileReader
Returns:
the minor version of this .class file
See Also:
IClassFileReader.getMinorVersion()

getSourceFileAttribute

public ISourceAttribute getSourceFileAttribute()
Description copied from interface: IClassFileReader
Answer the source file attribute, if it exists, null otherwise.

Specified by:
getSourceFileAttribute in interface IClassFileReader
Returns:
the source file attribute, if it exists, null otherwise
See Also:
IClassFileReader.getSourceFileAttribute()

getSuperclassIndex

public int getSuperclassIndex()
Description copied from interface: IClassFileReader
Answer back the index of the superclass name in the constant pool of the .class file. Answer 0 if this .class file represents java.lang.Object.

Specified by:
getSuperclassIndex in interface IClassFileReader
Returns:
the index of the superclass name in the constant pool of the .class file, 0 if this .class file represents java.lang.Object.
See Also:
IClassFileReader.getSuperclassIndex()

getSuperclassName

public char[] getSuperclassName()
Description copied from interface: IClassFileReader
Answer back the qualified name of the superclass of this .class file. The name is returned as described in the JVM specifications. Answer null if getSuperclassIndex() is zero.

Specified by:
getSuperclassName in interface IClassFileReader
Returns:
the qualified name of the superclass of this .class file, null if getSuperclassIndex() is zero
See Also:
IClassFileReader.getSuperclassName()

isClass

public boolean isClass()
Description copied from interface: IClassFileReader
Answer true if this .class file represents an class, false otherwise.

Specified by:
isClass in interface IClassFileReader
Returns:
true if this .class file represents an class, false otherwise
See Also:
IClassFileReader.isClass()

isInterface

public boolean isInterface()
Description copied from interface: IClassFileReader
Answer true if this .class file represents an interface, false otherwise.

Specified by:
isInterface in interface IClassFileReader
Returns:
true if this .class file represents an interface, false otherwise
See Also:
IClassFileReader.isInterface()