V - The class name of the view that is to be validated.M - The class name of the model object that backs the view. This
parameter is used only if using the constructor that takes two
parameters.public class JDOViewValidator<V,M> extends ViewValidator<V>
© Copyright 2008 Sans Pareil Technologies, Inc.
| Modifier and Type | Field and Description |
|---|---|
protected M |
model
The model object backing the
ViewValidator.view. |
fields, view| Constructor and Description |
|---|
JDOViewValidator(V view)
Create a new instance of the validator for the specified view.
|
JDOViewValidator(V view,
M model)
Create a new instance of the validator for the specified view and
backing model.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkUnique(Collection<Field> viewFields)
Check that the combination of the values represented by the specified
fields in the
ViewValidator.view do not represent an existing model
object in the data store. |
protected Collection<Field> |
fetchViewFields(javax.jdo.annotations.Unique unique)
Process the unqiue annotation specified at the class level in
model or its super-class. |
protected Object |
getValue(Field field)
Return the value of the specified
Field in
ViewValidator.view. |
protected void |
processUnique(Collection<String> messages)
Process unique constraint annotations in
model and perform
validation on the corresponding data in ViewValidator.view. |
Collection<String> |
validate()
Perform the validation on the child components.
|
checkConfirm, checkText, processListComponent, processRegex, processTextComponentprotected final M model
ViewValidator.view.public JDOViewValidator(V view) throws BindingException
getModel method that
returns the model object.view - The view that is to be validated.BindingException - If errors are encountered while executing the
getModel method.public Collection<String> validate()
validate in class ViewValidator<V>ViewValidator.validate()protected void processUnique(Collection<String> messages)
model and perform
validation on the corresponding data in ViewValidator.view.messages - The collection to which appropriate error messages
are to be added.fetchViewFields(javax.jdo.annotations.Unique),
checkUnique(java.util.Collection<java.lang.reflect.Field>)protected Collection<Field> fetchViewFields(javax.jdo.annotations.Unique unique)
model or its super-class. This method may be called
recursively to process all annotations in the class hierarchy.unique - The annotation that is to be processed.protected boolean checkUnique(Collection<Field> viewFields)
ViewValidator.view do not represent an existing model
object in the data store.viewFields - The fields corresponding to the fields in the
model whose values are to be checked.true if the values in the ViewValidator.view
represents a unique combination that may be persisted to the data
store.protected Object getValue(Field field)
Field in
ViewValidator.view.field - The field whose value is to be retrieved.ViewValidator.view.