org.springframework.binding.form
Interface ValidatingFormModel

All Superinterfaces:
ConfigurableFormModel, FormModel, HierarchicalFormModel, PropertyChangePublisher
All Known Implementing Classes:
DefaultFormModel

public interface ValidatingFormModel
extends ConfigurableFormModel, HierarchicalFormModel

Sub-interface implemented by form models that can validate its own properties.

Author:
Keith Donald, Oliver Hutchison

Field Summary
static String VALIDATING_PROPERTY
           
 
Fields inherited from interface org.springframework.binding.form.FormModel
COMMITTABLE_PROPERTY, DIRTY_PROPERTY, ENABLED_PROPERTY, READONLY_PROPERTY
 
Method Summary
 void clearValidationMessage(ValidationMessage validationMessage)
          Clear validation messages that are generated by a process separate from the standard Validator.
 boolean getHasErrors()
          Does this ValidatingFormModel or any of its children contain errors?
 ValidationResultsModel getValidationResults()
          Returns the ValidationResultsModel which encapsulates the set of validation messages currently active against this form model.
 Validator getValidator()
          Get the validator that will be used to validate the form model.
 boolean isValidating()
          Is this form model currently validating?
 void raiseValidationMessage(ValidationMessage validationMessage)
          Provide validation messages that are generated by a process separate from the standard Validator.
 void setValidating(boolean validating)
          Sets whether or not validation is currently enabled for this form model.
 void setValidator(Validator validator)
          Set the validator that will be used to validate the form model.
 void validate()
          Forces the form model to validate its self.
 
Methods inherited from interface org.springframework.binding.form.ConfigurableFormModel
add, add, add, addMethod, addMethod, setEnabled, setId, setReadOnly
 
Methods inherited from interface org.springframework.binding.form.HierarchicalFormModel
addChild, getChildren, getParent, removeChild, removeParent, setParent
 
Methods inherited from interface org.springframework.binding.form.FormModel
addCommitListener, commit, getFieldFace, getFieldMetadata, getFieldNames, getFormObject, getFormObjectHolder, getId, getValueModel, getValueModel, hasValueModel, isBuffered, isCommittable, isDirty, isEnabled, isReadOnly, registerPropertyConverter, removeCommitListener, reset, revert, setFormObject
 
Methods inherited from interface org.springframework.binding.value.PropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

VALIDATING_PROPERTY

static final String VALIDATING_PROPERTY
See Also:
Constant Field Values
Method Detail

getValidationResults

ValidationResultsModel getValidationResults()
Returns the ValidationResultsModel which encapsulates the set of validation messages currently active against this form model. Will be empty if validation is disabled.


getHasErrors

boolean getHasErrors()
Does this ValidatingFormModel or any of its children contain errors?


isValidating

boolean isValidating()
Is this form model currently validating?


setValidating

void setValidating(boolean validating)
Sets whether or not validation is currently enabled for this form model. If validation is enabled the form model will immediately validate all form properties. If validation is disabled all validation messages held by the ValidationResultsModel will be cleared.


validate

void validate()
Forces the form model to validate its self. If validation is disabled it does nothing.


getValidator

Validator getValidator()
Get the validator that will be used to validate the form model.


setValidator

void setValidator(Validator validator)
Set the validator that will be used to validate the form model.


raiseValidationMessage

void raiseValidationMessage(ValidationMessage validationMessage)
Provide validation messages that are generated by a process separate from the standard Validator.

All error messages that are raised using this method must be cleared using the method #cleanValdationMessage(ValidationMessage) before the form model can be commited.

Parameters:
validationMessage - the message to raise

clearValidationMessage

void clearValidationMessage(ValidationMessage validationMessage)
Clear validation messages that are generated by a process separate from the standard Validator.

Parameters:
validationMessage - the message to clear


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.