fr.umlv.corosol.classfile.attribute.impl
Class DefaultJExceptionHandler

java.lang.Object
  extended by fr.umlv.corosol.classfile.attribute.impl.DefaultJExceptionHandler
All Implemented Interfaces:
JExceptionHandler, JClassFileItem, JObject

public class DefaultJExceptionHandler
extends java.lang.Object
implements JExceptionHandler

The default implementation of the JExceptionHandler interface.

Author:
Christophe Deleray
See Also:
JCodeAttribute

Constructor Summary
DefaultJExceptionHandler()
          The default constructor.
 
Method Summary
 java.lang.String getCatchType()
          Returns the name of the class of exceptions that a method is designated to catch.
 int getCatchTypeIndex()
          Returns an index into the constant pool indicating a class of exceptions that this exception handler is designated to catch.
 JConstantPool getConstantPool()
          Returns the constant pool of this classfile item.
 int getEndPC()
          Returns the end position in the byte code array at which the exception handler is active.
 int getHandlerPC()
          Returns the start of this exception handler into the byte code array.
 int getStartPC()
          Returns the start position in the byte code array at which the exception handler is active.
 void readItem(JClassFileInput in)
          Extracts the data of this classfile part from the specified input stream.
 void setCatchType(java.lang.String name)
          Sets the index into the constant pool indicating the class of exceptions specified by name that a method is designated to catch.
 void setCatchTypeIndex(int index)
          Sets the index into the constant pool indicating a class of exceptions that a method is designated to catch.
 void setConstantPool(JConstantPool constantPool)
          Sets the constant pool of this classfile item.
 void setEndPC(int endPC)
          Sets the end position in the byte code array at which the exception handler is active.
 void setHandlerPC(int handlerPC)
          Sets the start of this exception handler into the byte code array.
 void setStartPC(int startPC)
          Sets the start position in the byte code array at which the exception handler is active.
 java.lang.String toString()
          Returns a string representation of this JExceptionHandler object.
 void writeItem(JClassFileOutput out)
          Writes the data of this classfile item into a file via the specified output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultJExceptionHandler

public DefaultJExceptionHandler()
The default constructor.

Method Detail

getStartPC

public int getStartPC()
Returns the start position in the byte code array at which the exception handler is active.

Specified by:
getStartPC in interface JExceptionHandler

getEndPC

public int getEndPC()
Returns the end position in the byte code array at which the exception handler is active.

Specified by:
getEndPC in interface JExceptionHandler

getHandlerPC

public int getHandlerPC()
Returns the start of this exception handler into the byte code array.

Specified by:
getHandlerPC in interface JExceptionHandler

getCatchTypeIndex

public int getCatchTypeIndex()
Returns an index into the constant pool indicating a class of exceptions that this exception handler is designated to catch.

Specified by:
getCatchTypeIndex in interface JExceptionHandler

getCatchType

public java.lang.String getCatchType()
Returns the name of the class of exceptions that a method is designated to catch.

Specified by:
getCatchType in interface JExceptionHandler

getConstantPool

public JConstantPool getConstantPool()
Returns the constant pool of this classfile item.

Specified by:
getConstantPool in interface JClassFileItem

setConstantPool

public void setConstantPool(JConstantPool constantPool)
Sets the constant pool of this classfile item.

Specified by:
setConstantPool in interface JClassFileItem
Parameters:
constantPool - the constant Pool

setStartPC

public void setStartPC(int startPC)
Sets the start position in the byte code array at which the exception handler is active.

Specified by:
setStartPC in interface JExceptionHandler
Parameters:
startPC - the start position at which the exception handler is active

setEndPC

public void setEndPC(int endPC)
Sets the end position in the byte code array at which the exception handler is active.

Specified by:
setEndPC in interface JExceptionHandler
Parameters:
endPC - the end position at which the exception handler is active

setHandlerPC

public void setHandlerPC(int handlerPC)
Sets the start of this exception handler into the byte code array.

Specified by:
setHandlerPC in interface JExceptionHandler
Parameters:
handlerPC - the start of this exception handler into the byte code array.

setCatchTypeIndex

public void setCatchTypeIndex(int index)
Sets the index into the constant pool indicating a class of exceptions that a method is designated to catch.

Specified by:
setCatchTypeIndex in interface JExceptionHandler
Parameters:
index - an index of a constant pool entry indicating a class of exceptions that this exception handler is designated to catch

setCatchType

public void setCatchType(java.lang.String name)
Sets the index into the constant pool indicating the class of exceptions specified by name that a method is designated to catch.

Specified by:
setCatchType in interface JExceptionHandler
Parameters:
name - the class of exceptions that a method is designated to catch

toString

public java.lang.String toString()
Returns a string representation of this JExceptionHandler object.

Specified by:
toString in interface JExceptionHandler
Overrides:
toString in class java.lang.Object

readItem

public void readItem(JClassFileInput in)
              throws java.io.IOException
Extracts the data of this classfile part from the specified input stream.

Specified by:
readItem in interface JClassFileItem
Parameters:
in - a class file input stream
Throws:
java.io.IOException - if an I/O error occurs when reading the datas of this description of an exception handler

writeItem

public void writeItem(JClassFileOutput out)
               throws java.io.IOException
Writes the data of this classfile item into a file via the specified output stream.

Specified by:
writeItem in interface JClassFileItem
Parameters:
out - a class file output stream
Throws:
java.io.IOException - if an I/O error occurs when writing into the classfile