|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
com.x1seven.hydrogen.validation.ValidationException
public class ValidationException
Indicates that one or more rules failed during validation. For the actual
failure messages, retrieve the Messages object using the
getMessages() method.
Note that the ValidationException should never have a root cause. It is thrown in response to a breach of some validation rule.
| Constructor Summary | |
|---|---|
ValidationException()
Constructs a new empty ValidationException. |
|
ValidationException(Messages messages)
Constructs a new ValidationException containing the supplied Messages collection. |
|
| Method Summary | |
|---|---|
int |
count()
Convenience method to return the number of messages in this ValidationException. |
java.util.Iterator |
get()
Convenience method to get the iterator for the full collection of Messages held by this ValidationException. |
java.util.Iterator |
get(java.lang.String property)
Convenience method to get an iterator for the Message objects
that have been registered against the specified property. |
Messages |
getMessages()
Retrieves the Messages collection that contains the actual
messages for this ValidationException. |
boolean |
hasMessages()
Convenience method to find out if the Messages collection held
by this ValidationException contains objects. |
boolean |
isEmpty()
Convenience method to find out if the Messages collection held
by this ValidationException is empty. |
void |
setMessages(Messages messages)
Sets the Messages collection for this ValidationException. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, 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 |
| Constructor Detail |
|---|
public ValidationException()
Constructs a new empty ValidationException.
public ValidationException(Messages messages)
Constructs a new ValidationException containing the supplied
Messages collection.
messages - the Messages collection to use for this
ValidationException| Method Detail |
|---|
public Messages getMessages()
Retrieves the Messages collection that contains the actual
messages for this ValidationException.
Messages collection held by
this ValidationExceptionpublic void setMessages(Messages messages)
Sets the Messages collection for this ValidationException.
messages - Messages collection containing
validation messages for this
ValidationExceptionpublic java.util.Iterator get()
Convenience method to get the iterator for the full collection of
Messages held by this ValidationException.
public java.util.Iterator get(java.lang.String property)
Convenience method to get an iterator for the Message objects
that have been registered against the specified property.
property - the property for which Messages should
public int count()
Convenience method to return the number of messages in this ValidationException.
public boolean hasMessages()
Convenience method to find out if the Messages collection held
by this ValidationException contains objects.
public boolean isEmpty()
Convenience method to find out if the Messages collection held
by this ValidationException is empty.
Messages collection
held by this ValidationException is
empty and false otherwise
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||