mjc

org.multijava.util
Class FormattedException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.multijava.util.FormattedException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GuigenError, LexgenError, MsggenError, OptgenError, PositionedError

public class FormattedException
extends Exception

This class defines exceptions formatted using message descriptions.


Field Summary
private  Message message
           
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
FormattedException(String msg)
           
FormattedException(Message message)
          An exception with a formatted message as argument
FormattedException(MessageDescription description)
          An exception without parameters
FormattedException(MessageDescription description, Object parameter)
          An exception with one parameter
FormattedException(MessageDescription description, Object parameter1, Object parameter2)
          An exception with two parameters
FormattedException(MessageDescription description, Object[] parameters)
          An exception with an arbitrary number of parameters
 
Method Summary
 String getErrorMessage()
          Returns the string explaining the exception.
 Message getFormattedMessage()
          Returns the formatted message.
 String getMessage()
          Returns a string explaining the exception.
 boolean hasDescription(MessageDescription description)
          Returns true iff the error has specified description.
 
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

message

private final transient Message message
Constructor Detail

FormattedException

public FormattedException(Message message)
An exception with a formatted message as argument

Parameters:
message - the formatted message

FormattedException

public FormattedException(MessageDescription description,
                          Object[] parameters)
An exception with an arbitrary number of parameters

Parameters:
description - the message description
parameters - the array of parameters

FormattedException

public FormattedException(MessageDescription description,
                          Object parameter1,
                          Object parameter2)
An exception with two parameters

Parameters:
description - the message description
parameter1 - the first parameter
parameter2 - the second parameter

FormattedException

public FormattedException(MessageDescription description,
                          Object parameter)
An exception with one parameter

Parameters:
description - the message description
parameter - the parameter

FormattedException

public FormattedException(MessageDescription description)
An exception without parameters

Parameters:
description - the message description

FormattedException

public FormattedException(String msg)
Method Detail

getMessage

public String getMessage()
Returns a string explaining the exception.

Overrides:
getMessage in class Throwable

getFormattedMessage

public Message getFormattedMessage()
Returns the formatted message.


getErrorMessage

public String getErrorMessage()
Returns the string explaining the exception.


hasDescription

public boolean hasDescription(MessageDescription description)
Returns true iff the error has specified description.


mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.