ej-technologies

org.gjt.jclasslib.structures
Class CPInfo

java.lang.Object
  extended byorg.gjt.jclasslib.structures.AbstractStructure
      extended byorg.gjt.jclasslib.structures.CPInfo
Direct Known Subclasses:
ConstantClassInfo, ConstantLargeNumeric, ConstantNameAndTypeInfo, ConstantNumeric, ConstantReference, ConstantStringInfo, ConstantUtf8Info

public abstract class CPInfo
extends AbstractStructure

Base class for all constant pool entries in the constants package.

Version:
$Revision: 1.6 $ $Date: 2004/12/28 13:04:32 $
Author:
Ingo Kegel, Vitor Carreira

Field Summary
static byte CONSTANT_CLASS
           
static String CONSTANT_CLASS_VERBOSE
           
static byte CONSTANT_DOUBLE
           
static String CONSTANT_DOUBLE_VERBOSE
           
static byte CONSTANT_FIELDREF
           
static String CONSTANT_FIELDREF_VERBOSE
           
static byte CONSTANT_FLOAT
           
static String CONSTANT_FLOAT_VERBOSE
           
static byte CONSTANT_INTEGER
           
static String CONSTANT_INTEGER_VERBOSE
           
static byte CONSTANT_INTERFACE_METHODREF
           
static String CONSTANT_INTERFACE_METHODREF_VERBOSE
           
static byte CONSTANT_LONG
           
static String CONSTANT_LONG_VERBOSE
           
static byte CONSTANT_METHODREF
           
static String CONSTANT_METHODREF_VERBOSE
           
static byte CONSTANT_NAME_AND_TYPE
           
static String CONSTANT_NAME_AND_TYPE_VERBOSE
           
static byte CONSTANT_STRING
           
static String CONSTANT_STRING_VERBOSE
           
static byte CONSTANT_UTF8
           
static String CONSTANT_UTF8_VERBOSE
           
 
Fields inherited from class org.gjt.jclasslib.structures.AbstractStructure
classFile, debug, SYSTEM_PROPERTY_DEBUG
 
Constructor Summary
CPInfo()
           
 
Method Summary
static CPInfo create(DataInput in, ClassFile classFile)
          Factory method for creating CPInfo structures.
 boolean equals(Object object)
           
abstract  byte getTag()
          Get the value of the tag field of the cp_info structure.
abstract  String getTagVerbose()
          Get the verbose description of the tag field of the cp_info structure.
 String getVerbose()
          Get the verbose description of the content of the constant pool entry.
 int hashCode()
           
protected  String printAccessFlagsVerbose(int accessFlags)
          Utility method for derived structures.
static int skip(DataInput in)
          Skip a CPInfo structure in a DataInput.
 
Methods inherited from class org.gjt.jclasslib.structures.AbstractStructure
debug, getClassFile, getDebug, getLength, printAccessFlags, printAccessFlagsVerbose, printBytes, read, setClassFile, setDebug, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_CLASS

public static final byte CONSTANT_CLASS
See Also:
Constant Field Values

CONSTANT_FIELDREF

public static final byte CONSTANT_FIELDREF
See Also:
Constant Field Values

CONSTANT_METHODREF

public static final byte CONSTANT_METHODREF
See Also:
Constant Field Values

CONSTANT_INTERFACE_METHODREF

public static final byte CONSTANT_INTERFACE_METHODREF
See Also:
Constant Field Values

CONSTANT_STRING

public static final byte CONSTANT_STRING
See Also:
Constant Field Values

CONSTANT_INTEGER

public static final byte CONSTANT_INTEGER
See Also:
Constant Field Values

CONSTANT_FLOAT

public static final byte CONSTANT_FLOAT
See Also:
Constant Field Values

CONSTANT_LONG

public static final byte CONSTANT_LONG
See Also:
Constant Field Values

CONSTANT_DOUBLE

public static final byte CONSTANT_DOUBLE
See Also:
Constant Field Values

CONSTANT_NAME_AND_TYPE

public static final byte CONSTANT_NAME_AND_TYPE
See Also:
Constant Field Values

CONSTANT_UTF8

public static final byte CONSTANT_UTF8
See Also:
Constant Field Values

CONSTANT_CLASS_VERBOSE

public static final String CONSTANT_CLASS_VERBOSE
See Also:
Constant Field Values

CONSTANT_FIELDREF_VERBOSE

public static final String CONSTANT_FIELDREF_VERBOSE
See Also:
Constant Field Values

CONSTANT_METHODREF_VERBOSE

public static final String CONSTANT_METHODREF_VERBOSE
See Also:
Constant Field Values

CONSTANT_INTERFACE_METHODREF_VERBOSE

public static final String CONSTANT_INTERFACE_METHODREF_VERBOSE
See Also:
Constant Field Values

CONSTANT_STRING_VERBOSE

public static final String CONSTANT_STRING_VERBOSE
See Also:
Constant Field Values

CONSTANT_INTEGER_VERBOSE

public static final String CONSTANT_INTEGER_VERBOSE
See Also:
Constant Field Values

CONSTANT_FLOAT_VERBOSE

public static final String CONSTANT_FLOAT_VERBOSE
See Also:
Constant Field Values

CONSTANT_LONG_VERBOSE

public static final String CONSTANT_LONG_VERBOSE
See Also:
Constant Field Values

CONSTANT_DOUBLE_VERBOSE

public static final String CONSTANT_DOUBLE_VERBOSE
See Also:
Constant Field Values

CONSTANT_NAME_AND_TYPE_VERBOSE

public static final String CONSTANT_NAME_AND_TYPE_VERBOSE
See Also:
Constant Field Values

CONSTANT_UTF8_VERBOSE

public static final String CONSTANT_UTF8_VERBOSE
See Also:
Constant Field Values
Constructor Detail

CPInfo

public CPInfo()
Method Detail

create

public static CPInfo create(DataInput in,
                            ClassFile classFile)
                     throws InvalidByteCodeException,
                            IOException
Factory method for creating CPInfo structures.

A CPInfo of the appropriate subtype from the constants package is created.

Parameters:
in - the DataInput from which to read the CPInfo structure
classFile - the parent class file of the structure to be created
Returns:
the new CPInfo structure
Throws:
InvalidByteCodeException - if the byte code is invalid
IOException - if an exception occurs with the DataInput

getTag

public abstract byte getTag()
Get the value of the tag field of the cp_info structure.

Returns:
the tag

getTagVerbose

public abstract String getTagVerbose()
Get the verbose description of the tag field of the cp_info structure.

Returns:
the verbose description

getVerbose

public String getVerbose()
                  throws InvalidByteCodeException
Get the verbose description of the content of the constant pool entry.

Returns:
the verbose description
Throws:
InvalidByteCodeException - if the byte code is invalid

skip

public static int skip(DataInput in)
                throws InvalidByteCodeException,
                       IOException
Skip a CPInfo structure in a DataInput.

Parameters:
in - the DataInput from which to read the CPInfo structure
Returns:
the number of bytes skipped
Throws:
InvalidByteCodeException - if the byte code is invalid
IOException - if an exception occurs with the DataInput

equals

public boolean equals(Object object)

hashCode

public int hashCode()

printAccessFlagsVerbose

protected String printAccessFlagsVerbose(int accessFlags)
Description copied from class: AbstractStructure
Utility method for derived structures. Print an access flag as a space separated list of verbose java access modifiers.

Specified by:
printAccessFlagsVerbose in class AbstractStructure
Parameters:
accessFlags - the unsigned short value to print as a hex string
Returns:
the hex string

ej-technologies