ej-technologies

org.gjt.jclasslib.structures.elementvalues
Class ElementValue

java.lang.Object
  extended byorg.gjt.jclasslib.structures.AbstractStructure
      extended byorg.gjt.jclasslib.structures.elementvalues.ElementValue
Direct Known Subclasses:
AnnotationElementValue, ArrayElementValue, ClassElementValue, ConstElementValue, EnumElementValue

public abstract class ElementValue
extends AbstractStructure

Describes an ElementValue attribute structure.

Version:
$Revision: 1.1 $ $Date: 2004/12/28 13:04:32 $
Author:
Vitor Carreira

Field Summary
static char ANNOTATION_TAG
           
static String ANNOTATION_TAG_VERBOSE
           
static char ARRAY_TAG
           
static String ARRAY_TAG_VERBOSE
           
static char BOOL_TAG
           
static String BOOL_TAG_VERBOSE
           
static char BYTE_TAG
           
static String BYTE_TAG_VERBOSE
           
static char CHAR_TAG
           
static String CHAR_TAG_VERBOSE
           
static char CLASS_TAG
           
static String CLASS_TAG_VERBOSE
           
static char DOUBLE_TAG
           
static String DOUBLE_TAG_VERBOSE
           
static char ENUM_TAG
           
static String ENUM_TAG_VERBOSE
           
static char FLOAT_TAG
           
static String FLOAT_TAG_VERBOSE
           
protected static int INITIAL_LENGTH
           
static char INT_TAG
           
static String INT_TAG_VERBOSE
           
static char LONG_TAG
           
static String LONG_TAG_VERBOSE
           
static char SHORT_TAG
           
static String SHORT_TAG_VERBOSE
           
static char STRING_TAG
           
static String STRING_TAG_VERBOSE
           
 
Fields inherited from class org.gjt.jclasslib.structures.AbstractStructure
classFile, debug, SYSTEM_PROPERTY_DEBUG
 
Constructor Summary
ElementValue(int tag)
           
 
Method Summary
static ElementValue create(DataInput in, ClassFile classFile)
          Factory for creating ElementValue structures.
abstract  String getEntryName()
           
 int getLength()
           
protected abstract  int getSpecificLength()
           
 int getTag()
           
static String getTagDescription(int tag)
           
protected  String printAccessFlagsVerbose(int accessFlags)
          Utility method for derived structures.
 void write(DataOutput out)
          Write this structure to the given DataOutput.
 
Methods inherited from class org.gjt.jclasslib.structures.AbstractStructure
debug, getClassFile, getDebug, getLength, printAccessFlags, printAccessFlagsVerbose, printBytes, read, setClassFile, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_TAG

public static final char BYTE_TAG
See Also:
Constant Field Values

CHAR_TAG

public static final char CHAR_TAG
See Also:
Constant Field Values

DOUBLE_TAG

public static final char DOUBLE_TAG
See Also:
Constant Field Values

FLOAT_TAG

public static final char FLOAT_TAG
See Also:
Constant Field Values

INT_TAG

public static final char INT_TAG
See Also:
Constant Field Values

LONG_TAG

public static final char LONG_TAG
See Also:
Constant Field Values

SHORT_TAG

public static final char SHORT_TAG
See Also:
Constant Field Values

BOOL_TAG

public static final char BOOL_TAG
See Also:
Constant Field Values

STRING_TAG

public static final char STRING_TAG
See Also:
Constant Field Values

ENUM_TAG

public static final char ENUM_TAG
See Also:
Constant Field Values

CLASS_TAG

public static final char CLASS_TAG
See Also:
Constant Field Values

ARRAY_TAG

public static final char ARRAY_TAG
See Also:
Constant Field Values

ANNOTATION_TAG

public static final char ANNOTATION_TAG
See Also:
Constant Field Values

BYTE_TAG_VERBOSE

public static final String BYTE_TAG_VERBOSE
See Also:
Constant Field Values

CHAR_TAG_VERBOSE

public static final String CHAR_TAG_VERBOSE
See Also:
Constant Field Values

DOUBLE_TAG_VERBOSE

public static final String DOUBLE_TAG_VERBOSE
See Also:
Constant Field Values

FLOAT_TAG_VERBOSE

public static final String FLOAT_TAG_VERBOSE
See Also:
Constant Field Values

INT_TAG_VERBOSE

public static final String INT_TAG_VERBOSE
See Also:
Constant Field Values

LONG_TAG_VERBOSE

public static final String LONG_TAG_VERBOSE
See Also:
Constant Field Values

SHORT_TAG_VERBOSE

public static final String SHORT_TAG_VERBOSE
See Also:
Constant Field Values

BOOL_TAG_VERBOSE

public static final String BOOL_TAG_VERBOSE
See Also:
Constant Field Values

STRING_TAG_VERBOSE

public static final String STRING_TAG_VERBOSE
See Also:
Constant Field Values

ENUM_TAG_VERBOSE

public static final String ENUM_TAG_VERBOSE
See Also:
Constant Field Values

CLASS_TAG_VERBOSE

public static final String CLASS_TAG_VERBOSE
See Also:
Constant Field Values

ARRAY_TAG_VERBOSE

public static final String ARRAY_TAG_VERBOSE
See Also:
Constant Field Values

ANNOTATION_TAG_VERBOSE

public static final String ANNOTATION_TAG_VERBOSE
See Also:
Constant Field Values

INITIAL_LENGTH

protected static final int INITIAL_LENGTH
See Also:
Constant Field Values
Constructor Detail

ElementValue

public ElementValue(int tag)
Method Detail

create

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

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

write

public void write(DataOutput out)
           throws InvalidByteCodeException,
                  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:
IOException - if an exception occurs with the DataOutput
InvalidByteCodeException - if the structure is internally inconsistent

getSpecificLength

protected abstract int getSpecificLength()

getLength

public final int getLength()

getEntryName

public abstract String getEntryName()

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

getTag

public int getTag()

getTagDescription

public static String getTagDescription(int tag)

ej-technologies