Interface TransformerWrapper

  • All Known Implementing Classes:
    DefaultTransformerWrapper, DummyWrapper

    public interface TransformerWrapper

    Definition of an interface for objects that wrap a transformer.

    The main task of a TransformerWrapper is to provide a specialized TransformerContext for a Transformer. A client can use the wrapper exactly as a normal transformer, but does not have to care for the context. Occurring exceptions when invoking the transformer must also be caught and redirected as runtime exceptions.

    This simplifies working with transformers and also makes it possible to inject alternative context implementations.

    Version:
    $Id: TransformerWrapper.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    See Also:
    Transformer
    • Method Detail

      • transform

        Object transform​(Object o)
        Invokes the wrapped transformer for transforming the passed in object. For a client of this interface this method call should almost be equivalent with calling a transformer directly (with the exception that no checked exception is thrown). It is up to a concrete implementation how this call is delegated to a real transformer.
        Parameters:
        o - the object to be transformed
        Returns:
        the result of the transformation