Logo Search packages:      
Sourcecode: janino version File versions  Download package

org::codehaus::janino::util::ClassFile Class Reference

List of all members.

Detailed Description

An object that represents the JavaTM "class file" format.

ClassFile(InputStream) creates a ClassFile object from the bytecode read from the given InputStream.

store(OutputStream) generates JavaTM bytecode which is suitable for being processed by a JavaTM virtual machine.

Definition at line 53 of file ClassFile.java.

Public Member Functions

short addConstantClassInfo (String typeFD)
short addConstantDoubleInfo (final double value)
short addConstantFieldrefInfo (String classFD, String fieldName, String fieldFD)
short addConstantFloatInfo (final float value)
short addConstantIntegerInfo (final int value)
short addConstantInterfaceMethodrefInfo (String classFD, String methodName, String methodMD)
short addConstantLongInfo (final long value)
short addConstantMethodrefInfo (String classFD, String methodName, String methodMD)
short addConstantStringInfo (String string)
short addConstantUtf8Info (final String s)
void addDeprecatedAttribute ()
FieldInfo addFieldInfo (short accessFlags, String fieldName, String fieldTypeFD, Object optionalConstantValue)
void addInnerClassesAttributeEntry (InnerClassesAttribute.Entry e)
MethodInfo addMethodInfo (short accessFlags, String methodName, String methodMD)
void addSourceFileAttribute (String sourceFileName)
 ClassFile (InputStream inputStream) throws IOException, ClassFormatError
 ClassFile (short accessFlags, String thisClassFD, String superclassFD, String[] interfaceFDs)
String getConstantClassName (short index)
ConstantPoolInfo getConstantPoolInfo (short index)
String getConstantUtf8 (short index)
InnerClassesAttribute getInnerClassesAttribute ()
short getMajorVersion ()
short getMinorVersion ()
String getThisClassName ()
void setVersion (short majorVersion, short minorVersion)
void store (OutputStream os) throws IOException
byte[] toByteArray ()

Static Public Member Functions

static String getClassFileResourceName (String className)
static String getSourceResourceName (String className)
static boolean isRecognizedVersion (short majorVersion, short minorVersion)

Public Attributes

short accessFlags
List constantPool
List fieldInfos
short[] interfaces
List methodInfos
short superclass
short thisClass

Static Public Attributes

static final short MAJOR_VERSION_JDK_1_1 = 45
static final short MAJOR_VERSION_JDK_1_2 = 46
static final short MAJOR_VERSION_JDK_1_3 = 47
static final short MAJOR_VERSION_JDK_1_4 = 48
static final short MAJOR_VERSION_JDK_1_5 = 49
static final short MINOR_VERSION_JDK_1_1 = 3
static final short MINOR_VERSION_JDK_1_2 = 0
static final short MINOR_VERSION_JDK_1_3 = 0
static final short MINOR_VERSION_JDK_1_4 = 0
static final short MINOR_VERSION_JDK_1_5 = 0

Private Member Functions

short addConstantNameAndTypeInfo (String name, String descriptor)
short addConstantSIFLDInfo (Object cv)
short addToConstantPool (ConstantPoolInfo cpi)
AttributeInfo loadAttribute (DataInputStream dis) throws IOException
List loadAttributes (DataInputStream dis) throws IOException
void loadConstantPool (DataInputStream dis) throws IOException
List loadFields (DataInputStream dis) throws IOException
MethodInfo loadMethodInfo (DataInputStream dis) throws IOException
List loadMethods (DataInputStream dis) throws IOException

Static Private Member Functions

static byte[] readLengthAndBytes (DataInputStream dis) throws IOException
static short[] readShortArray (DataInputStream dis) throws IOException
static void storeAttributes (DataOutputStream dos, List attributeInfos) throws IOException
static void storeConstantPool (DataOutputStream dos, List constantPool) throws IOException
static void storeFields (DataOutputStream dos, List fieldInfos) throws IOException
static void storeMethods (DataOutputStream dos, List methodInfos) throws IOException
static void storeShortArray (DataOutputStream dos, short[] sa) throws IOException

Private Attributes

List attributes
Map constantPoolMap
short majorVersion
short minorVersion

Static Private Attributes

static final int CLASS_FILE_MAGIC = 0xcafebabe


class  AttributeInfo
class  CodeAttribute
class  ConstantClassInfo
class  ConstantDoubleInfo
class  ConstantFieldrefInfo
class  ConstantFloatInfo
class  ConstantIntegerInfo
class  ConstantInterfaceMethodrefInfo
class  ConstantLongInfo
class  ConstantMethodrefInfo
class  ConstantNameAndTypeInfo
class  ConstantPoolInfo
class  ConstantStringInfo
class  ConstantUtf8Info
class  ConstantValueAttribute
class  ConstantValuePoolInfo
class  DeprecatedAttribute
class  ExceptionsAttribute
class  FieldInfo
class  InnerClassesAttribute
class  LineNumberTableAttribute
class  LocalVariableTableAttribute
class  MethodInfo
class  SourceFileAttribute
class  SyntheticAttribute

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index