|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.binding.validation.support.RulesValidator
public class RulesValidator
Implementation of a RichValidator
which will check the formObject
against rules found in a RulesSource
. This RulesSource
can
be specifically supplied, which allows multiple rulesSources, or can be
globally defined in the Application Context. In the latter case the
RulesValidator
will look for the specific RulesSource
type in
the context.
When validating an object, all results are cached. Any following validation of a specific property will validate that property, update the cached results accordingly and return all validation results of the object.
Constructor Summary | |
---|---|
RulesValidator(FormModel formModel)
Creates a RulesValidator for the given formModel. |
|
RulesValidator(FormModel formModel,
RulesSource rulesSource)
Create a RulesValidator which uses the supplied RulesSource on the FormModel. |
Method Summary | |
---|---|
void |
clearMessages()
Clear the current validationMessages and the errors. |
protected void |
constraintSatisfied(PropertyConstraint exp)
|
protected void |
constraintViolated(PropertyConstraint exp,
PropertyResults propertyResults)
|
String |
getRulesContextId()
Returns the rules context id set on this validator. |
String |
resolveObjectName(String objectName)
resolves a field name to a user friendly display name |
void |
setRulesContextId(String rulesContextId)
Set the rules context id. |
ValidationResults |
validate(Object object)
Validates the provided object. |
ValidationResults |
validate(Object object,
String propertyName)
Validates the given property of the provided object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RulesValidator(FormModel formModel)
org.springframework.richclient.application.ApplicationServices#getRulesSource()
public RulesValidator(FormModel formModel, RulesSource rulesSource)
Method Detail |
---|
public ValidationResults validate(Object object)
validate
in interface Validator
object
- the object to validate
public ValidationResults validate(Object object, String propertyName)
validate
in interface RichValidator
object
- the object to validate (may be an implementation ofpropertyName
- the name of the only property that has changed since the
last call to validate.
protected void constraintSatisfied(PropertyConstraint exp)
protected void constraintViolated(PropertyConstraint exp, PropertyResults propertyResults)
public String getRulesContextId()
public void setRulesContextId(String rulesContextId)
RulesSource.getRules(Class, String)
to allow for context specific
rules.
rulesContextId
- public String resolveObjectName(String objectName)
resolveObjectName
in interface ObjectNameResolver
public void clearMessages()
validate(Object, String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |