|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjef.dna.attributes.impl.ExceptionTableEntry
@ContainedInCodeAttribute(containerPropertyName="attributeContainer") public class ExceptionTableEntry
Class representing an ExceptionTable
generic entry. These entries describe the
exception handlers behaviour in the code array of a Code
attribute. An entry is
made up of four elements: start_pc, end_pc, handler_pc, catch_type
. These entries
are stored within a Code
attribute ExceptionTable
.
Field Summary | |
---|---|
protected static Logger |
logger
|
Constructor Summary | |
---|---|
ExceptionTableEntry()
Constructor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
The clone() method will return a new instance whose reference to the
containing CodeAttribute is not modified. |
void |
fromStream(java.io.DataInputStream dis)
Reads the entry from the given inputstream. |
CodeAttribute |
getAttributeContainer()
Get the reference to the CodeAttribute this ExceptionTableEntry
is held by. |
int |
getBytesCount()
This method must return the overall number of bytes required by the component implementing this interface. |
int |
getCatchType()
If the value of type is non zero, it must refer to an entry of the constant
pool table of type ConstantClass (ConstantClassInfo ). |
int |
getEndPc()
Gets the index at which the exception handler becomes inactive. |
int |
getHandlerPc()
Gets the start of the exception handler. |
int |
getStartPc()
Gets the index at which the exception handler begins being active. |
void |
setAttributeContainer(CodeAttribute attribute)
Set the reference to the CodeAttribute this ExceptionTableEntry
is held by. |
void |
setCatchType(int type)
If the value of type is non zero, it must refer to an entry of the constant
pool table of type ConstantClass (ConstantClassInfo ). |
void |
setEndPc(int end)
Sets the index at which the exception handler becomes inactive. |
void |
setHandlerPc(int handler)
Sets the start of the exception handler. |
void |
setStartPc(int start)
Sets the index at which the exception handler begins being active. |
void |
toStream(java.io.DataOutputStream dos)
Writes this entry to the given output stream. |
void |
updateRefs(int offset)
Updates all the reference to the constant pool table |
boolean |
validate()
This method has to perform a validation process over the ExceptionTableEntry
according to what specified by the JVM Official Specification. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Logger logger
Constructor Detail |
---|
public ExceptionTableEntry()
fromStream
method. Appropriate getters and setters are provided as well.
Method Detail |
---|
public void setStartPc(int start)
code array of Code
attribute
instance.
- Specified by:
setStartPc
in interface ExceptionTableEntry
- Parameters:
start
- The index at which the exc. handler becomes active
public int getStartPc()
code array of Code
attribute
instance.
- Specified by:
getStartPc
in interface ExceptionTableEntry
- Returns:
- int The index at which the exc. handler becomes active
public void setEndPc(int end)
code array of Code
attribute
instance.
- Specified by:
setEndPc
in interface ExceptionTableEntry
- Parameters:
end
- The index at which the exc. handler gets deactivated
public int getEndPc()
code array of Code
attribute
instance.
- Specified by:
getEndPc
in interface ExceptionTableEntry
- Returns:
- int The index at which the exc. handler gets deactivated
public void setHandlerPc(int handler)
code array of Code
attribute
instance.
- Specified by:
setHandlerPc
in interface ExceptionTableEntry
- Parameters:
handler
- The start of the exception handler
public int getHandlerPc()
code array of Code
attribute
instance.
- Specified by:
getHandlerPc
in interface ExceptionTableEntry
- Returns:
- int The start of the exception handler
public void setCatchType(int type)
type
is non zero, it must refer to an entry of the constant
pool table of type ConstantClass
(ConstantClassInfo
).
setCatchType
in interface ExceptionTableEntry
type
- Valid index into the constant pool tablepublic int getCatchType()
type
is non zero, it must refer to an entry of the constant
pool table of type ConstantClass
(ConstantClassInfo
).
getCatchType
in interface ExceptionTableEntry
public void setAttributeContainer(CodeAttribute attribute)
ExceptionTableEntry
CodeAttribute
this ExceptionTableEntry
is held by.
setAttributeContainer
in interface ExceptionTableEntry
attribute
- The CodeAttribute
containerpublic CodeAttribute getAttributeContainer()
ExceptionTableEntry
CodeAttribute
this ExceptionTableEntry
is held by.
getAttributeContainer
in interface ExceptionTableEntry
CodeAttribute
containerpublic void toStream(java.io.DataOutputStream dos) throws java.io.IOException
toStream
in interface ExceptionTableEntry
dos
- Output stream to write the entry to
java.io.IOException
- Thrown should something go wrong with the provided output streampublic void fromStream(java.io.DataInputStream dis) throws java.io.IOException
fromStream
in interface ExceptionTableEntry
dis
- Input stream to read the entry from
java.io.IOException
- Thrown should something go wrong with the provided input streampublic void updateRefs(int offset)
updateRefs
in interface ExceptionTableEntry
offset
- The offset to be appliedpublic boolean validate() throws ExceptionTableEntryValidationException, MissingDnaContainerException, MissingAttributeContainerException, MissingCPTableException
ExceptionTableEntry
ExceptionTableEntry
according to what specified by the JVM Official Specification.
validate
in interface ExceptionTableEntry
ExceptionTableEntryValidationException
- The validation failed
MissingDnaContainerException
- Is missing the reference to the Dna
instance this
ExceptionTableEntry
belongs to
MissingAttributeContainerException
- Is missing the reference to the Attribute
this
ExceptionTableEntry
belongs to
MissingCPTableException
- Cannot access the constant pool tablepublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone()
method will return a new instance whose reference to the
containing CodeAttribute
is not modified.
clone
in interface ExceptionTableEntry
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public int getBytesCount()
BytesCountable
getBytesCount
in interface BytesCountable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |