es.uc3m.it.xbe32.tlv
Class TLVParseException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byes.uc3m.it.xbe32.tlv.TLVParseException
All Implemented Interfaces:
Serializable

public class TLVParseException
extends Exception

Exception class for errors occuring while parsing XBE32 TLVs.

See Also:
TLVParser.parse(), Serialized Form

Constructor Summary
TLVParseException(Exception ex)
          Creates a new TLVParseException with an encapsulated Exception
TLVParseException(String msg, int type)
          Creates a new TLVParseException with the specified message, that occurred while parsing the specified TLV
TLVParseException(String msg, int type, int offset)
          Creates a new TLVParseException with the specified message, that occurred while parsing the specified TLV at the specified InputStream position
 
Method Summary
 Exception getException()
          Returns the encapsulated Exception, if any
 String getMessage()
          Returns the detail message string of this Exception.
 int getOffset()
          Returns the position at the InputStream where the parsing error occurs
 void setOffset(int off)
          Sets the position at the InputStream where the parsing error occurs
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TLVParseException

public TLVParseException(String msg,
                         int type)
Creates a new TLVParseException with the specified message, that occurred while parsing the specified TLV

Parameters:
msg - the error message
type - the Type of the invalid TLV

TLVParseException

public TLVParseException(String msg,
                         int type,
                         int offset)
Creates a new TLVParseException with the specified message, that occurred while parsing the specified TLV at the specified InputStream position

Parameters:
msg - the error message
type - the Type of the invalid TLV
offset - the position of the invalid TLV in the InputStream

TLVParseException

public TLVParseException(Exception ex)
Creates a new TLVParseException with an encapsulated Exception

Parameters:
ex - the Exception to be encapsulated
Method Detail

getException

public Exception getException()
Returns the encapsulated Exception, if any

Returns:
the encapsulated Exception

getOffset

public int getOffset()
Returns the position at the InputStream where the parsing error occurs

Returns:
the error's position, or -1 if unknown

setOffset

public void setOffset(int off)
Sets the position at the InputStream where the parsing error occurs

Parameters:
off - the error's position

getMessage

public String getMessage()
Returns the detail message string of this Exception.

Returns:
the detail message string of this Exception (which may be null).