org.ow2.opensuit.core.validation
Class ValidationErrors

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.ow2.opensuit.core.validation.ValidationErrors
All Implemented Interfaces:
java.io.Serializable

public class ValidationErrors
extends java.lang.Exception

This is the main container for validation errors. It is use by open SUIT control code to handle form validation programmatically. It is an Exception, and contains a list of errors, each being related to a single field item, or global to the form.

Author:
psmeyers
See Also:
Serialized Form

Constructor Summary
ValidationErrors()
           
 
Method Summary
 void addErrors(ValidationErrors iErrors)
          Allows to add all validation errors from the given container.
 void addGlobalError(ValidationError iError)
          Adds a global error (for the form).
 void addItemError(java.lang.String id, ValidationError iError)
          Adds a validation error related to a single form field.
 java.util.List<ValidationError> getGlobalErrors()
           
 java.util.List<ValidationError> getItemErrors(java.lang.String id)
           
 boolean hasErrors()
           
 boolean hasGlobalErrors()
           
 boolean hasItemErrors(java.lang.String iID)
           
 
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

ValidationErrors

public ValidationErrors()
Method Detail

addErrors

public void addErrors(ValidationErrors iErrors)
Allows to add all validation errors from the given container.

Parameters:
iErrors -

addGlobalError

public void addGlobalError(ValidationError iError)
Adds a global error (for the form).

Parameters:
iError -

addItemError

public void addItemError(java.lang.String id,
                         ValidationError iError)
Adds a validation error related to a single form field.

Parameters:
id - The field id (basically this is the binding expression).
iError - The error message.

getGlobalErrors

public java.util.List<ValidationError> getGlobalErrors()

getItemErrors

public java.util.List<ValidationError> getItemErrors(java.lang.String id)

hasErrors

public boolean hasErrors()

hasGlobalErrors

public boolean hasGlobalErrors()

hasItemErrors

public boolean hasItemErrors(java.lang.String iID)


Copyright © 2008-2012 OW2 Consortium. All Rights Reserved.