ej-technologies

org.gjt.jclasslib.structures.constants
Class ConstantMethodHandleInfo

java.lang.Object
  extended by org.gjt.jclasslib.structures.AbstractStructure
      extended by org.gjt.jclasslib.structures.CPInfo
          extended by org.gjt.jclasslib.structures.constants.ConstantMethodHandleInfo

public class ConstantMethodHandleInfo
extends CPInfo

Describes a CONSTANT_MethodHandle_info constant pool data structure.

Version:
$Revision: 1.1 $ $Date: 2010-07-26 14:00:09 $
Author:
Hannes Kegel

Field Summary
static int SIZE
          Length of the constant pool data structure in bytes.
static int TYPE_GET_FIELD
           
static int TYPE_GET_STATIC
           
static int TYPE_INVOKE_INTERFACE
           
static int TYPE_INVOKE_SPECIAL
           
static int TYPE_INVOKE_STATIC
           
static int TYPE_INVOKE_VIRTUAL
           
static int TYPE_NEW_INVOKE_SPECIAL
           
static int TYPE_PUT_FIELD
           
static int TYPE_PUT_STATIC
           
 
Fields inherited from class org.gjt.jclasslib.structures.CPInfo
CONSTANT_CLASS, CONSTANT_CLASS_VERBOSE, CONSTANT_DOUBLE, CONSTANT_DOUBLE_VERBOSE, CONSTANT_FIELDREF, CONSTANT_FIELDREF_VERBOSE, CONSTANT_FLOAT, CONSTANT_FLOAT_VERBOSE, CONSTANT_INTEGER, CONSTANT_INTEGER_VERBOSE, CONSTANT_INTERFACE_METHODREF, CONSTANT_INTERFACE_METHODREF_VERBOSE, CONSTANT_LONG, CONSTANT_LONG_VERBOSE, CONSTANT_METHOD_HANDLE, CONSTANT_METHOD_HANDLE_VERBOSE, CONSTANT_METHOD_TYPE, CONSTANT_METHOD_TYPE_VERBOSE, CONSTANT_METHODREF, CONSTANT_METHODREF_VERBOSE, CONSTANT_NAME_AND_TYPE, CONSTANT_NAME_AND_TYPE_VERBOSE, CONSTANT_STRING, CONSTANT_STRING_VERBOSE, CONSTANT_UTF8, CONSTANT_UTF8_VERBOSE
 
Fields inherited from class org.gjt.jclasslib.structures.AbstractStructure
classFile, debug, SYSTEM_PROPERTY_DEBUG
 
Constructor Summary
ConstantMethodHandleInfo()
           
 
Method Summary
protected  void debug(java.lang.String message)
          Utility method for derived structures.
 boolean equals(java.lang.Object object)
           
 java.lang.String getName()
          Get the descriptor.
 int getReferenceIndex()
          Get the index of the constant pool entry containing the reference.
 byte getTag()
          Get the value of the tag field of the cp_info structure.
 java.lang.String getTagVerbose()
          Get the verbose description of the tag field of the cp_info structure.
 int getType()
           
 java.lang.String getVerbose()
          Get the verbose description of the content of the constant pool entry.
 int hashCode()
           
 void read(java.io.DataInput in)
          Read this structure from the given DataInput.
 void setReferenceIndex(int referenceIndex)
          Set the index of the constant pool entry containing the reference.
 void setType(int type)
           
 void write(java.io.DataOutput out)
          Write this structure to the given DataOutput.
 
Methods inherited from class org.gjt.jclasslib.structures.CPInfo
create, printAccessFlagsVerbose, skip
 
Methods inherited from class org.gjt.jclasslib.structures.AbstractStructure
getClassFile, getDebug, getLength, printAccessFlags, printAccessFlagsVerbose, printBytes, setClassFile, setDebug
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE

public static final int SIZE
Length of the constant pool data structure in bytes.

See Also:
Constant Field Values

TYPE_GET_FIELD

public static final int TYPE_GET_FIELD
See Also:
Constant Field Values

TYPE_GET_STATIC

public static final int TYPE_GET_STATIC
See Also:
Constant Field Values

TYPE_PUT_FIELD

public static final int TYPE_PUT_FIELD
See Also:
Constant Field Values

TYPE_PUT_STATIC

public static final int TYPE_PUT_STATIC
See Also:
Constant Field Values

TYPE_INVOKE_VIRTUAL

public static final int TYPE_INVOKE_VIRTUAL
See Also:
Constant Field Values

TYPE_INVOKE_STATIC

public static final int TYPE_INVOKE_STATIC
See Also:
Constant Field Values

TYPE_INVOKE_SPECIAL

public static final int TYPE_INVOKE_SPECIAL
See Also:
Constant Field Values

TYPE_NEW_INVOKE_SPECIAL

public static final int TYPE_NEW_INVOKE_SPECIAL
See Also:
Constant Field Values

TYPE_INVOKE_INTERFACE

public static final int TYPE_INVOKE_INTERFACE
See Also:
Constant Field Values
Constructor Detail

ConstantMethodHandleInfo

public ConstantMethodHandleInfo()
Method Detail

getTag

public byte getTag()
Description copied from class: CPInfo
Get the value of the tag field of the cp_info structure.

Specified by:
getTag in class CPInfo
Returns:
the tag

getTagVerbose

public java.lang.String getTagVerbose()
Description copied from class: CPInfo
Get the verbose description of the tag field of the cp_info structure.

Specified by:
getTagVerbose in class CPInfo
Returns:
the verbose description

getVerbose

public java.lang.String getVerbose()
                            throws InvalidByteCodeException
Description copied from class: CPInfo
Get the verbose description of the content of the constant pool entry.

Overrides:
getVerbose in class CPInfo
Returns:
the verbose description
Throws:
InvalidByteCodeException - if the byte code is invalid

getReferenceIndex

public int getReferenceIndex()
Get the index of the constant pool entry containing the reference.

Returns:
the index

setReferenceIndex

public void setReferenceIndex(int referenceIndex)
Set the index of the constant pool entry containing the reference.

Parameters:
referenceIndex - the index

getType

public int getType()

setType

public void setType(int type)

getName

public java.lang.String getName()
                         throws InvalidByteCodeException
Get the descriptor.

Returns:
the descriptor
Throws:
InvalidByteCodeException - if the byte code is invalid

read

public void read(java.io.DataInput in)
          throws InvalidByteCodeException,
                 java.io.IOException
Description copied from class: AbstractStructure
Read this structure from the given DataInput.

Excpects DataInput to be in JVM class file format and just before a structure of this kind. No look ahead parsing since the class file format is deterministic.

Overrides:
read in class AbstractStructure
Parameters:
in - the DataInput from which to read
Throws:
InvalidByteCodeException - if the byte code is invalid
java.io.IOException - if an exception occurs with the DataInput

write

public void write(java.io.DataOutput out)
           throws InvalidByteCodeException,
                  java.io.IOException
Description copied from class: AbstractStructure
Write this structure to the given DataOutput.

The written bytes are in JVM class file format.

Overrides:
write in class AbstractStructure
Parameters:
out - the DataOutput to which to write
Throws:
InvalidByteCodeException - if the structure is internally inconsistent
java.io.IOException - if an exception occurs with the DataOutput

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class CPInfo

hashCode

public int hashCode()
Overrides:
hashCode in class CPInfo

debug

protected void debug(java.lang.String message)
Description copied from class: AbstractStructure
Utility method for derived structures. Dump a specific debug message.

Overrides:
debug in class AbstractStructure
Parameters:
message - the debug message

ej-technologies