net.sf.oswf.exceptions
Class InvalidInputException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by net.sf.oswf.exceptions.WorkflowException
              extended by net.sf.oswf.exceptions.InvalidInputException
All Implemented Interfaces:
java.io.Serializable

public class InvalidInputException
extends WorkflowException

Exception to indicate the user input is invalid. Handles both general errors and errors specific to an input.

See Also:
Serialized Form

Constructor Summary
InvalidInputException()
           
InvalidInputException(java.lang.Object o)
          Creates a new exception using the supplied Object as a generic base.
InvalidInputException(java.lang.String error)
          Creates a new exception with an associated generic error.
InvalidInputException(java.lang.String name, java.lang.String error)
          Creates a new exception with an error specific to an input.
 
Method Summary
 void addError(java.lang.String error)
          Adds a generic error.
 void addError(java.lang.String name, java.lang.String error)
          Adds an input-specific error.
 java.util.Map getErrors()
          Returns a map (String->String) of the input-specific errors.
 java.util.List<java.lang.String> getGenericErrors()
          Returns a list (String) of generic errors.
 java.lang.String toString()
           
 
Methods inherited from class net.sf.oswf.exceptions.WorkflowException
getCause, getMessage, getRootCause, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidInputException

public InvalidInputException()

InvalidInputException

public InvalidInputException(java.lang.Object o)
Creates a new exception using the supplied Object as a generic base. If the object is an instance of this exception, all properties are copied to this exception. If the object is an instance of Map or String[], an errorName->errorMessage mapping will be attempted to be extracted. If the object is something else, it's toString() method will be called and added as a single generic error.

Parameters:
o - the object

InvalidInputException

public InvalidInputException(java.lang.String error)
Creates a new exception with an associated generic error.

Parameters:
error - a generic error message

InvalidInputException

public InvalidInputException(java.lang.String name,
                             java.lang.String error)
Creates a new exception with an error specific to an input.

Parameters:
name - the input name that contains the error
error - an error about the given name
Method Detail

getErrors

public java.util.Map getErrors()
Returns a map (String->String) of the input-specific errors.

Returns:
a map (String->String) of the input-specific errors

getGenericErrors

public java.util.List<java.lang.String> getGenericErrors()
Returns a list (String) of generic errors.

Returns:
A list (String) of generic errors

addError

public void addError(java.lang.String error)
Adds a generic error.

Parameters:
error - the generic error message

addError

public void addError(java.lang.String name,
                     java.lang.String error)
Adds an input-specific error.

Parameters:
name - the name of the input
error - the error message

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable