|
|||||||||
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 | +--com.blackperl.Perl.TrException
A class for exceptions thrown by the Tr
class.
In some cases, exceptions from within the tr
method may want
to attach the pattern that was being analyzed when the exception occurred.
For these cases, this class defines additional constructors (besides the
ones inherited from java.lang.RuntimeException
) that allow
specifying the offending pattern. Receivers of exceptions constructed from
this class may then use the getBadPattern
method to later
retrieve the pattern.
Using this approach, the message of the exception object can still be used to describe the exact nature of the error, and receivers do not have to resort to string-parsing or other manipulations to pull the pattern out of the message.
The one limitation here is that it is not possibly to create an exception object of this class with just the bad pattern. Because this signature conflicts with an existing constructor signature from the parent class, any attempt to set the pattern during initialization must use the forms documented here, in which at least one other parameter is also provided.
Field Summary |
Fields inherited from class java.lang.RuntimeException |
|
Constructor Summary | |
TrException(java.lang.String message,
java.lang.String pattern)
Create an exception with the specified error message and offending tr pattern. |
|
TrException(java.lang.String message,
java.lang.Throwable cause,
java.lang.String pattern)
Create an exception with the specified error message, using the given Throwable instance as the cause, and the given
tr pattern. |
|
TrException(java.lang.Throwable cause,
java.lang.String pattern)
Create an exception using the given Throwable instance as
the cause, and the given tr pattern. |
Method Summary | |
java.lang.String |
getBadPattern()
Retrieve the offending pattern for this instance. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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 |
public TrException(java.lang.String message, java.lang.String pattern)
tr
pattern.
message
- The message of the exceptionpattern
- The offending pattern stringpublic TrException(java.lang.String message, java.lang.Throwable cause, java.lang.String pattern)
Throwable
instance as the cause, and the given
tr
pattern.
message
- The message of the exceptioncause
- The lower-level exception that led to thispattern
- The offending pattern stringpublic TrException(java.lang.Throwable cause, java.lang.String pattern)
Throwable
instance as
the cause, and the given tr
pattern.
cause
- The lower-level exception that led to thispattern
- The offending pattern stringMethod Detail |
public java.lang.String getBadPattern()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |