|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.gui.validation.AbstractValidator<B>
net.sf.doolin.gui.validation.SimpleValidator<B>
B - Type of object for the viewpublic class SimpleValidator<B>
Validator based on textual declarations.
Each validation has the following format:
<validation> := <context>=<validators> <context> := <key>:<property>[:<name>] <validators> := Comma-separated list of <validator>where:
key: Key that identifies the field in error, usually mapped
to the field
name
property: Path to the property to test on the model
name: String key to the name of the field (defaults to the
field name)
validator: key used to identify an ObjectValidator
for the validation (see below)
validator keys are used to identify ObjectValidator
instances. Predefined ones are:
It is possible to declare new keys using the
setObjectValidators(Map) method or the objectValidators
property.
| Nested Class Summary | |
|---|---|
protected class |
SimpleValidator.SimpleValidation
Validation support that operates as a link to an ObjectValidator
instance. |
| Constructor Summary | |
|---|---|
SimpleValidator()
|
|
| Method Summary | |
|---|---|
Map<String,ObjectValidator> |
getObjectValidators()
Gets the map between the validator keys and the
ObjectValidator instances. |
List<String> |
getValidations()
Gets the validations. |
void |
init()
Initialises the object validators. |
void |
setObjectValidators(Map<String,ObjectValidator> objectValidators)
Sets the map between the validator keys and the
ObjectValidator instances. |
void |
setValidations(List<String> validations)
Sets the validations. |
void |
subscribe(SubscriberValidator validator,
B model,
Runnable runnable)
Subscribes the validator to the model changes. |
protected void |
validate(GUIValidation validationResult,
B bean)
Validate. |
| Methods inherited from class net.sf.doolin.gui.validation.AbstractValidator |
|---|
getMsgMandatoryKey, isNotBlank, isNotNull, setMsgMandatoryKey, validate, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleValidator()
| Method Detail |
|---|
public Map<String,ObjectValidator> getObjectValidators()
validator keys and the
ObjectValidator instances.
public List<String> getValidations()
@PostConstruct
public void init()
throws IllegalArgumentException
IllegalArgumentException - If there is problem of parsingpublic void setObjectValidators(Map<String,ObjectValidator> objectValidators)
validator keys and the
ObjectValidator instances.
objectValidators - Validatorspublic void setValidations(List<String> validations)
validations - the new validations
public void subscribe(SubscriberValidator validator,
B model,
Runnable runnable)
GUIValidator
validator - Subscription validatormodel - Model to subscribe torunnable - Task to subscribe
protected void validate(GUIValidation validationResult,
B bean)
validate in class AbstractValidator<B>validationResult - the validation resultbean - the bean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||