|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException java.lang.IllegalArgumentException java.lang.NumberFormatException net.sf.ivmaidns.util.ParserException
public class ParserException
Class for custom parser exceptions.
This class extends the semantics of
NumberFormatException
class and is used to signal
that a particular error has been reached at a particular index
unexpectedly while parsing a string or its region. Important
notes: this exception class may be overridden (if needed).
UnsignedInt
,
UnsignedLong
,
ByteVector
,
Serialized FormField Summary | |
---|---|
protected int |
error
The error reason code explaining why this exception
is thrown during the string region being parsed. |
protected int |
index
The parsed string index at which this exception
occurs during the string region being parsed. |
protected java.lang.String |
str
The string containing the region being parsed. |
Constructor Summary | |
---|---|
ParserException()
The default no-argument exception constructor. |
|
ParserException(java.lang.String str,
int index,
int error)
The standard parser exception constructor. |
Method Summary | |
---|---|
int |
getError()
Returns the error reason code explaining why parsing has failed. |
int |
getIndex()
Returns the string index at which parsing has failed. |
java.lang.String |
getMessage()
Returns the detailed message of the exception. |
java.lang.String |
getStr()
Returns the string containing the region being parsed. |
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 |
Field Detail |
---|
protected java.lang.String str
null
.
ParserException()
,
ParserException(java.lang.String, int, int)
,
getStr()
,
index
,
error
protected int index
this
exception
occurs during the string region being parsed.
Important notes: index may be of any integer value; if
its value is negative then it should be treated as zero; if its
value is too big then it should be treated as
length()
of str (only if str
is not null
else it should be treated as zero).
ParserException()
,
ParserException(java.lang.String, int, int)
,
getIndex()
,
str
,
error
protected int error
this
exception
is thrown during the string region being parsed.
Important notes: error may be of any integer value; if
its value is not positive then it should be treated as zero
(indicating an unknown error).
ParserException()
,
ParserException(java.lang.String, int, int)
,
getError()
,
str
,
index
Constructor Detail |
---|
public ParserException()
null
, index and
error are set to zero.
ParserException(java.lang.String, int, int)
,
getMessage()
public ParserException(java.lang.String str, int index, int error)
str
- the string containing the region being parsed (may be
null
, in fact).index
- the string index (may be of any integer value) at which parsing
has failed.error
- the reason code (may be of any integer value) explaining why
parsing has failed.ParserException()
,
getMessage()
,
getStr()
,
getIndex()
,
getError()
Method Detail |
---|
public final java.lang.String getStr()
null
) with the region being
parsed.ParserException(java.lang.String, int, int)
,
getIndex()
,
getError()
public final int getIndex()
length()
of
getStr()
(only if getStr()
is not
null
else it should be treated as zero).
ParserException(java.lang.String, int, int)
,
getStr()
,
getError()
public final int getError()
ParserException(java.lang.String, int, int)
,
getStr()
,
getIndex()
public java.lang.String getMessage()
getMessage()
one.
The resulting string is a concatenation of the following:
"Error", error represented as a signed decimal
integer, ":", index represented as a signed decimal
integer too, ":" and str (if not null
).
getMessage
in class java.lang.Throwable
null
) describing
this
parser exception.
java.lang.OutOfMemoryError
- if there is not enough memory.ParserException(java.lang.String, int, int)
,
getStr()
,
getIndex()
,
getError()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |