Package com.opensymphony.workflow
Class InvalidInputException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.opensymphony.workflow.WorkflowException
com.opensymphony.workflow.InvalidInputException
- All Implemented Interfaces:
Serializable
Exception to indicate the user input is invalid. Handles both general errors and errors specific to an input.
- Version:
- $Revision: 1.2 $
- Author:
- Patrick Lightbody
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new exception using the supplied Object as a generic base.InvalidInputException(String error) Creates a new exception with an associated generic error.InvalidInputException(String name, String error) Creates a new exception with an error specific to an input. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a generic error.voidAdds an input-specific error.Returns a map (String->String) of the input-specific errors.Returns a list (String) of generic errors.toString()Methods inherited from class com.opensymphony.workflow.WorkflowException
getCause, getMessage, getRootCause, printStackTrace, printStackTrace, printStackTraceMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Constructor Details
-
InvalidInputException
public InvalidInputException() -
InvalidInputException
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
Creates a new exception with an associated generic error.- Parameters:
error- a generic error message
-
InvalidInputException
Creates a new exception with an error specific to an input.- Parameters:
name- the input name that contains the errorerror- an error about the given name
-
-
Method Details
-
getErrors
Returns a map (String->String) of the input-specific errors.- Returns:
- a map (String->String) of the input-specific errors
-
getGenericErrors
Returns a list (String) of generic errors.- Returns:
- A list (String) of generic errors
-
addError
Adds a generic error.- Parameters:
error- the generic error message
-
addError
Adds an input-specific error.- Parameters:
name- the name of the inputerror- the error message
-
toString
-