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
ValidatorWrapper
interface.An instance of this class is constructed with a
Validator
and aTransformerContext
. A validation operation is implemented by delegating to theValidator
passing in theTransformerContext
.- Since:
- 1.3
- Version:
- $Id$
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description DefaultValidatorWrapper(Validator v, TransformerContext ctx)
Creates a new instance ofDefaultValidatorWrapper
and initializes it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransformerContext
getTransformerContext()
Returns theTransformerContext
to use.Validator
getValidator()
Returns the wrapped validator.ValidationResult
isValid(Object o)
Tests whether the specified object is valid.
-
-
-
Constructor Detail
-
DefaultValidatorWrapper
public DefaultValidatorWrapper(Validator v, TransformerContext ctx)
Creates a new instance ofDefaultValidatorWrapper
and 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 theTransformerContext
to use.- Returns:
- the transformer context
-
isValid
public ValidationResult isValid(Object o)
Tests whether the specified object is valid.- Specified by:
isValid
in interfaceValidatorWrapper
- Parameters:
o
- the object to test- Returns:
- a result object with information about the object's validity
-
-