public class ElementValuePair extends AbstractStructure
Modifier and Type | Field and Description |
---|---|
static String |
ENTRY_NAME |
classFile, debug, SYSTEM_PROPERTY_DEBUG
Constructor and Description |
---|
ElementValuePair() |
Modifier and Type | Method and Description |
---|---|
static ElementValuePair |
create(DataInput in,
ClassFile classFile)
Factory for creating ElementValuePair structures.
|
int |
getElementNameIndex()
Get the element_name_index of this element value pair.
|
ElementValue |
getElementValue()
Get the element_value of this element value pair.
|
String |
getEntryName() |
protected int |
getLength() |
protected String |
printAccessFlagsVerbose(int accessFlags)
Utility method for derived structures.
|
void |
read(DataInput in)
Read this structure from the given DataInput.
|
void |
setElementNameIndex(int elementNameIndex)
Set the element_name_index of this element value pair.
|
void |
setElementValue(ElementValue elementValue)
Set the element_value of this element value pair.
|
void |
write(DataOutput out)
Write this structure to the given DataOutput.
|
debug, getClassFile, getDebug, getLength, printAccessFlags, printAccessFlagsVerbose, printBytes, setClassFile, setDebug
public static final String ENTRY_NAME
public static ElementValuePair create(DataInput in, ClassFile classFile) throws InvalidByteCodeException, IOException
in
- the DataInput from which to read the
ElementValuePair structureclassFile
- the parent class file of the structure to be createdInvalidByteCodeException
- if the byte code is invalidIOException
- if an exception occurs with the DataInputpublic ElementValue getElementValue()
public void setElementValue(ElementValue elementValue)
elementValue
- the element_valuepublic int getElementNameIndex()
public void setElementNameIndex(int elementNameIndex)
elementNameIndex
- the element_name_indexpublic void read(DataInput in) throws InvalidByteCodeException, IOException
AbstractStructure
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.
read
in class AbstractStructure
in
- the DataInput from which to readInvalidByteCodeException
- if the byte code is invalidIOException
- if an exception occurs with the DataInputpublic void write(DataOutput out) throws InvalidByteCodeException, IOException
AbstractStructure
The written bytes are in JVM class file format.
write
in class AbstractStructure
out
- the DataOutput to which to writeInvalidByteCodeException
- if the structure is internally inconsistentIOException
- if an exception occurs with the DataOutputprotected String printAccessFlagsVerbose(int accessFlags)
AbstractStructure
printAccessFlagsVerbose
in class AbstractStructure
accessFlags
- the unsigned short value to print as a hex stringprotected int getLength()
public String getEntryName()