de.dante.extex.typesetter.exception
Class TypesetterHelpingException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byde.dante.util.exception.GeneralException
              extended byde.dante.extex.interpreter.exception.InterpreterException
                  extended byde.dante.extex.typesetter.exception.TypesetterException
                      extended byde.dante.extex.typesetter.exception.TypesetterHelpingException
All Implemented Interfaces:
java.io.Serializable

public class TypesetterHelpingException
extends TypesetterException

This class provides an Exception with the possibility to provide additional help on the error encoutered. 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.

Example

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 savely be used:
     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:

Version:
$Revision: 1.4 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
protected TypesetterHelpingException()
          Creates a new object.
  TypesetterHelpingException(Localizer theLocalizer, java.lang.String messageTag)
          Creates a new object without variable arguments.
  TypesetterHelpingException(Localizer theLocalizer, java.lang.String messageTag, java.lang.String a1)
          Creates a new object with one variable argument.
  TypesetterHelpingException(Localizer theLocalizer, java.lang.String messageTag, java.lang.String a1, java.lang.String a2)
          Creates a new object with two variable arguments.
  TypesetterHelpingException(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.
 
Method Summary
 java.lang.String getHelp()
          Getter for further help information.
 java.lang.String getLocalizedMessage()
          Getter for further help information.
 
Methods inherited from class de.dante.extex.interpreter.exception.InterpreterException
getLocalizer, isProcessed, setProcessed
 
Methods inherited from class de.dante.util.exception.GeneralException
getExitCode
 
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

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

TypesetterHelpingException

protected TypesetterHelpingException()
Creates a new object.


TypesetterHelpingException

public TypesetterHelpingException(Localizer theLocalizer,
                                  java.lang.String messageTag)
Creates a new object without variable arguments.

Parameters:
messageTag - the message
theLocalizer - the localizer to use

TypesetterHelpingException

public TypesetterHelpingException(Localizer theLocalizer,
                                  java.lang.String messageTag,
                                  java.lang.String a1)
Creates a new object with one variable argument.

Parameters:
messageTag - the message
a1 - the first argument
theLocalizer - the localizer to use

TypesetterHelpingException

public TypesetterHelpingException(Localizer theLocalizer,
                                  java.lang.String messageTag,
                                  java.lang.String a1,
                                  java.lang.String a2)
Creates a new object with two variable arguments.

Parameters:
messageTag - the message
a1 - the first argument
a2 - the second argument
theLocalizer - the localizer to use

TypesetterHelpingException

public TypesetterHelpingException(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.

Parameters:
messageTag - the message
a1 - the first argument
a2 - the second argument
a3 - the third argument
theLocalizer - the localizer to use
Method Detail

getHelp

public java.lang.String getHelp()
Getter for further help information.

Overrides:
getHelp in class GeneralException
Returns:
the help information

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Getter for further help information.

Returns:
the help information