Class 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 a TransformerContext. A validation operation is implemented by delegating to the Validator passing in the TransformerContext .

    Since:
    1.3
    Version:
    $Id$
    Author:
    Oliver Heger
    • Constructor Detail

      • DefaultValidatorWrapper

        public DefaultValidatorWrapper​(Validator v,
                                       TransformerContext ctx)
        Creates a new instance of DefaultValidatorWrapper 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 the TransformerContext to use.
        Returns:
        the transformer context
      • isValid

        public ValidationResult isValid​(Object o)
        Tests whether the specified object is valid.
        Specified by:
        isValid in interface ValidatorWrapper
        Parameters:
        o - the object to test
        Returns:
        a result object with information about the object's validity