public static final class CodeAttribute.ExceptionHandler extends java.lang.Object implements Node
ExceptionHandler
that can be found as a part of any CodeAttribute
instances.
This class is not thread-safe.
Modifier and Type | Method and Description |
---|---|
CodeAttribute.ExceptionHandler |
copy()
Returns a copy of this
ExceptionHandler instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of ExceptionHandler , and that ExceptionHandler instance is equal to this ExceptionHandler instance, false
otherwise. |
int |
getCatchType()
Returns the catch_type of this
ExceptionHandler instance. |
int |
getEndPC()
Returns the end_pc of this
ExceptionHandler instance. |
int |
getHandlerPC()
Returns the handler_pc of this
ExceptionHandler instance. |
int |
getLength()
Returns the length of this
ExceptionHandler instance. |
int |
getStartPC()
Returns the start_pc of this
ExceptionHandler instance. |
int |
hashCode()
Returns a hash code for this
ExceptionHandler instance. |
static CodeAttribute.ExceptionHandler |
newInstance(int startPC,
int endPC,
int handlerPC)
Returns a new
ExceptionHandler based on a start_pc, end_pc and handler_pc. |
void |
setCatchType(int catchType)
Sets a new catch_type for this
ExceptionHandler instance. |
void |
setEndPC(int endPC)
Sets a new end_pc for this
ExceptionHandler instance. |
void |
setHandlerPC(int handlerPC)
Sets a new handler_pc for this
ExceptionHandler instance. |
void |
setStartPC(int startPC)
Sets a new start_pc for this
ExceptionHandler instance. |
java.lang.String |
toString()
Returns a
String representation of this ExceptionHandler instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
ExceptionHandler to dataOutput . |
public CodeAttribute.ExceptionHandler copy()
ExceptionHandler
instance.ExceptionHandler
instancepublic java.lang.String toString()
String
representation of this ExceptionHandler
instance.toString
in class java.lang.Object
String
representation of this ExceptionHandler
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of ExceptionHandler
, and that ExceptionHandler
instance is equal to this ExceptionHandler
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this ExceptionHandler
instance for equalitytrue
if, and only if, object
is an instance of ExceptionHandler
, and that ExceptionHandler
instance is equal to this ExceptionHandler
instance, false
otherwisepublic int getCatchType()
ExceptionHandler
instance.ExceptionHandler
instancepublic int getEndPC()
ExceptionHandler
instance.ExceptionHandler
instancepublic int getHandlerPC()
ExceptionHandler
instance.ExceptionHandler
instancepublic int getLength()
ExceptionHandler
instance.
All ExceptionHandler
s have a length of 8
.
ExceptionHandler
instancepublic int getStartPC()
ExceptionHandler
instance.ExceptionHandler
instancepublic int hashCode()
ExceptionHandler
instance.hashCode
in class java.lang.Object
ExceptionHandler
instancepublic void setCatchType(int catchType)
ExceptionHandler
instance.
If catchType
is less than 0
, an IllegalArgumentException
will be thrown.
catchType
- the new catch_type for this ExceptionHandler
instancejava.lang.IllegalArgumentException
- thrown if, and only if, catchType
is less than 0
public void setEndPC(int endPC)
ExceptionHandler
instance.
If endPC
is less than or equal to getStartPC()
, an IllegalArgumentException
will be thrown.
endPC
- the new end_pc for this ExceptionHandler
instancejava.lang.IllegalArgumentException
- thrown if, and only if, endPC
is less than or equal to getStartPC()
public void setHandlerPC(int handlerPC)
ExceptionHandler
instance.
If handlerPC
is less than 1
, an IllegalArgumentException
will be thrown.
handlerPC
- the new handler_pc for this ExceptionHandler
instancejava.lang.IllegalArgumentException
- thrown if, and only if, handlerPC
is less than 1
public void setStartPC(int startPC)
ExceptionHandler
instance.
If startPC
is less than 1
or greater than or equal to getEndPC()
, an IllegalArgumentException
will be thrown.
startPC
- the new start_pc for this ExceptionHandler
instancejava.lang.IllegalArgumentException
- thrown if, and only if, startPC
is less 1
or greater than or equal to getEndPC()
public void write(java.io.DataOutput dataOutput)
ExceptionHandler
to dataOutput
.
If dataOutput
is an OutputStream
(or any other type of stream), this method will not close it.
If dataOutput
is null
, a NullPointerException
will be thrown.
If an I/O-error occurs, an UncheckedIOException
will be thrown.
dataOutput
- the DataOutput
to write tojava.lang.NullPointerException
- thrown if, and only if, dataOutput
is null
java.io.UncheckedIOException
- thrown if, and only if, an I/O-error occurspublic static CodeAttribute.ExceptionHandler newInstance(int startPC, int endPC, int handlerPC)
ExceptionHandler
based on a start_pc, end_pc and handler_pc.
If startPC
is less than 0
, endPC
is less than or equal to startPC
or handlerPC
is less than 0
, an IllegalArgumentException
will be thrown.
startPC
- the start_pc to useendPC
- the end_pc to usehandlerPC
- the handler_pc to useExceptionHandler
based on a start_pc, end_pc and handler_pcjava.lang.IllegalArgumentException
- thrown if, and only if, startPC
is less than 0
, endPC
is less than or equal to startPC
or handlerPC
is less than 0