Home » xwork-2.1.5 » com.opensymphony » xwork2 » [javadoc | source]
com.opensymphony.xwork2
public interface: ValidationAware [javadoc | source]

All Known Implementing Classes:
    ActionSupport, AppendingValidatorContext, DelegatingValidatorContext, ValidatorContext, LoggingValidationAware, ValidationAwareSupport

ValidationAware classes can accept Action (class level) or field level error messages. Action level messages are kept in a Collection. Field level error messages are kept in a Map from String field name to a List of field error msgs.
Method from com.opensymphony.xwork2.ValidationAware Summary:
addActionError,   addActionMessage,   addFieldError,   getActionErrors,   getActionMessages,   getFieldErrors,   hasActionErrors,   hasActionMessages,   hasErrors,   hasFieldErrors,   setActionErrors,   setActionMessages,   setFieldErrors
Method from com.opensymphony.xwork2.ValidationAware Detail:
 public  void addActionError(String anErrorMessage)
    Add an Action-level error message to this Action.
 public  void addActionMessage(String aMessage)
    Add an Action-level message to this Action.
 public  void addFieldError(String fieldName,
    String errorMessage)
    Add an error message for a given field.
 public Collection<String> getActionErrors()
    Get the Collection of Action-level error messages for this action. Error messages should not be added directly here, as implementations are free to return a new Collection or an Unmodifiable Collection.
 public Collection<String> getActionMessages()
    Get the Collection of Action-level messages for this action. Messages should not be added directly here, as implementations are free to return a new Collection or an Unmodifiable Collection.
 public Map<String> getFieldErrors()
    Get the field specific errors associated with this action. Error messages should not be added directly here, as implementations are free to return a new Collection or an Unmodifiable Collection.
 public boolean hasActionErrors()
    Check whether there are any Action-level error messages.
 public boolean hasActionMessages()
    Checks whether there are any Action-level messages.
 public boolean hasErrors()
    Checks whether there are any action errors or field errors.

    Note: that this does not have the same meaning as in WW 1.x.

 public boolean hasFieldErrors()
    Check whether there are any field errors associated with this action.
 public  void setActionErrors(Collection<String> errorMessages)
    Set the Collection of Action-level String error messages.
 public  void setActionMessages(Collection<String> messages)
    Set the Collection of Action-level String messages (not errors).
 public  void setFieldErrors(Map<String> errorMap)
    Set the field error map of fieldname (String) to Collection of String error messages.