Class DefaultTransformerWrapper

  • All Implemented Interfaces:
    TransformerWrapper

    public class DefaultTransformerWrapper
    extends Object
    implements TransformerWrapper

    A default implementation of the TransformerWrapper interface.

    An instance of this class is constructed with a Transformer and a TransformerContext. A transformation is implemented by delegating to the Transformer passing in the TransformerContext.

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

      • DefaultTransformerWrapper

        public DefaultTransformerWrapper​(Transformer t,
                                         TransformerContext ctx)
        Creates a new instance of DefaultTransformerWrapper and initializes it.
        Parameters:
        t - the transformer (must not be null)
        ctx - the transformer context (must not be null)
        Throws:
        IllegalArgumentException - if a required argument is missing
    • Method Detail

      • getTransformer

        public Transformer getTransformer()
        Returns the wrapped transformer.
        Returns:
        the transformer
      • getTransformerContext

        public TransformerContext getTransformerContext()
        Returns the transformer context to use.
        Returns:
        the transformer context
      • transform

        public Object transform​(Object o)
        Invokes the transformer.
        Specified by:
        transform in interface TransformerWrapper
        Parameters:
        o - the object to transform
        Returns:
        the transformed object