Package net.sf.jguiraffe.gui.forms
Class DefaultValidatorWrapper
- java.lang.Object
-
- net.sf.jguiraffe.gui.forms.DefaultValidatorWrapper
-
- All Implemented Interfaces:
ValidatorWrapper
public class DefaultValidatorWrapper extends Object implements ValidatorWrapper
A default implementation of the
ValidatorWrapperinterface.An instance of this class is constructed with a
Validatorand aTransformerContext. A validation operation is implemented by delegating to theValidatorpassing in theTransformerContext.- Since:
- 1.3
- Version:
- $Id$
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description DefaultValidatorWrapper(Validator v, TransformerContext ctx)Creates a new instance ofDefaultValidatorWrapperand initializes it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransformerContextgetTransformerContext()Returns theTransformerContextto use.ValidatorgetValidator()Returns the wrapped validator.ValidationResultisValid(Object o)Tests whether the specified object is valid.
-
-
-
Constructor Detail
-
DefaultValidatorWrapper
public DefaultValidatorWrapper(Validator v, TransformerContext ctx)
Creates a new instance ofDefaultValidatorWrapperand initializes it.- Parameters:
v- the wrapped validator (must not be null)ctx- the transformer context to use (must not be null)- Throws:
IllegalArgumentException- if a required parameter is missing
-
-
Method Detail
-
getValidator
public Validator getValidator()
Returns the wrapped validator.- Returns:
- the validator
-
getTransformerContext
public TransformerContext getTransformerContext()
Returns theTransformerContextto use.- Returns:
- the transformer context
-
isValid
public ValidationResult isValid(Object o)
Tests whether the specified object is valid.- Specified by:
isValidin interfaceValidatorWrapper- Parameters:
o- the object to test- Returns:
- a result object with information about the object's validity
-
-