Example usage for org.apache.commons.collections TransformerUtils mapTransformer

List of usage examples for org.apache.commons.collections TransformerUtils mapTransformer

Introduction

In this page you can find the example usage for org.apache.commons.collections TransformerUtils mapTransformer.

Prototype

public static Transformer mapTransformer(Map map) 

Source Link

Document

Creates a Transformer that uses the passed in Map to transform the input object (as a simple lookup).

Usage

From source file:net.sf.morph2.integration.commons.collections.TransformerToDecoratedConverterAdapterTestCase.java

/**
 * {@inheritDoc}/*  w  ww  . j  a v a2s.  co  m*/
 * @see net.sf.morph2.transform.transformers.BaseTransformerTestCase#createTransformer()
 */
protected Transformer createTransformer() {
    HashMap testMap = new HashMap();
    testMap.put("foo", "FOO");
    testMap.put("bar", "BAR");
    testMap.put("baz", "BAZ");
    return new TransformerToDecoratedConverterAdapter(TransformerUtils.mapTransformer(testMap));
}