|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.extex.core.exception.GeneralException
org.extex.core.exception.helping.HelpingException
public class HelpingException
This class provides an Exception with the possibility to provide additional help on the error encountered. Thus it has two levels of information: the first level is the message and the second level is the additional help.
Both information strings are mapped via the
Localizer apparatus. The key
provided to this Exception is used as a key to find the format in the
resource bundle. For the localized message of the exception it is used plain
and for the help the string ".help" is appended.
Consider the following lines in the resource (properties) file for the localizer:
abc.def = This is the message
abc.def.help = This is the help text. \
It can even span several lines.
Then the following instruction can be used save:
throw new HelpingException(localizer, "abc.def");
With this exception up to three arguments can be used. The String value of those arguments are inserted into the message string for the placeholders {0}, {1}, and {2}. Consider the following format definition in the resource of the localizer:
ghi = This is the {0} message: {2}
Then the instruction
new HelpingException(localizer, "ghi", "first", "second", "third");
will produce an exception with the following localized message:
This is the first message: third
Note that some special rules hold for strings in resource bundles:
| Field Summary | |
|---|---|
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
| Constructor Summary | |
|---|---|
protected |
HelpingException()
Creates a new object. |
|
HelpingException(Localizer theLocalizer,
java.lang.String messageTag)
Creates a new object without variable arguments. |
|
HelpingException(Localizer theLocalizer,
java.lang.String messageTag,
java.lang.String a1)
Creates a new object with one variable argument. |
|
HelpingException(Localizer theLocalizer,
java.lang.String messageTag,
java.lang.String a1,
java.lang.String a2)
Creates a new object with two variable arguments. |
|
HelpingException(Localizer theLocalizer,
java.lang.String messageTag,
java.lang.String a1,
java.lang.String a2,
java.lang.String a3)
Creates a new object with three variable arguments. |
protected |
HelpingException(java.lang.Throwable cause)
Creates a new object. |
| Method Summary | |
|---|---|
java.lang.String |
getHelp()
Getter for further help information. |
java.lang.String |
getLocalizedMessage()
Getter for further help information. |
| Methods inherited from class org.extex.core.exception.GeneralException |
|---|
getLocalizer, isProcessed, setProcessed |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, 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 |
| Field Detail |
|---|
protected static final long serialVersionUID
| Constructor Detail |
|---|
protected HelpingException()
public HelpingException(Localizer theLocalizer,
java.lang.String messageTag)
messageTag - the messagetheLocalizer - the localizer to use
public HelpingException(Localizer theLocalizer,
java.lang.String messageTag,
java.lang.String a1)
messageTag - the messagea1 - the first argumenttheLocalizer - the localizer to use
public HelpingException(Localizer theLocalizer,
java.lang.String messageTag,
java.lang.String a1,
java.lang.String a2)
messageTag - the messagea1 - the first argumenta2 - the second argumenttheLocalizer - the localizer to use
public HelpingException(Localizer theLocalizer,
java.lang.String messageTag,
java.lang.String a1,
java.lang.String a2,
java.lang.String a3)
messageTag - the messagea1 - the first argumenta2 - the second argumenta3 - the third argumenttheLocalizer - the localizer to useprotected HelpingException(java.lang.Throwable cause)
cause - the cause| Method Detail |
|---|
public java.lang.String getHelp()
getHelp in class GeneralExceptionpublic java.lang.String getLocalizedMessage()
getLocalizedMessage in class java.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||