public abstract class AbstractValidationListener<CompType extends javax.swing.JComponent,T> extends ValidationListener implements Validator<T>
CLIENT_PROP_NAME
Constructor and Description |
---|
AbstractValidationListener(CompType comp)
Create a new AbstractValidationListener for the single component
passed here as an argument.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
findComponentName(CompType comp)
Get the name of the component which should be passed to
validate.
|
protected abstract T |
getModelObject(CompType comp)
Get the model object that will be passed to validate
|
protected void |
onValidate(CompType component,
boolean validationResult)
Called when validation runs.
|
protected boolean |
validate(Problems problems)
Perform the validation.
|
abstract boolean |
validate(Problems problems,
java.lang.String compName,
T model)
Validate the passed model.
|
nameForComponent, setComponentName, validate, verify
public AbstractValidationListener(CompType comp)
comp
- protected java.lang.String findComponentName(CompType comp)
nameForComponent
which will either return the
client-property based name or the result of getName() on
the component.comp
- The componentprotected abstract T getModelObject(CompType comp)
comp
- The componentprotected void onValidate(CompType component, boolean validationResult)
component
- The componentvalidationResult
- The result of validationprotected final boolean validate(Problems problems)
ValidationListener
Typically you will not call this method yourself; rather, the
infrastructure will call it. Your subclass of ValidationListener
should implement some listener interface. When an interesting event
occurs, call super.validate() and the rest will be taken care of.
validate
in class ValidationListener
problems
- A set of problems which can be added to