Class DummyTransformer

  • All Implemented Interfaces:
    Transformer, Validator

    public class DummyTransformer
    extends Object
    implements Validator, Transformer

    This class provides dummy implementations for the Transformer and the Validator interfaces.

    Validation is implemented by always returning a validation result object indicating a successful validation. Transformation is implemented as a noop, by simply returning the passed in object. The services of this class can be obtained using a singleton instance.

    Version:
    $Id: DummyTransformer.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • DummyTransformer

        public DummyTransformer()
    • Method Detail

      • isValid

        public ValidationResult isValid​(Object o,
                                        TransformerContext ctx)
        Performs validation. Always returns a positive result.
        Specified by:
        isValid in interface Validator
        Parameters:
        o - the object to check
        ctx - the transformer context (ignored)
        Returns:
        validation results
      • transform

        public Object transform​(Object o,
                                TransformerContext ctx)
        Transforms the passed in object. This implementation simply returns the same object.
        Specified by:
        transform in interface Transformer
        Parameters:
        o - the object to be transformed
        ctx - the transformer context (ignored)
        Returns:
        the resulting object
      • getInstance

        public static DummyTransformer getInstance()
        Returns the singleton instance of this class.
        Returns:
        the shared instance