public class MapValueLookupTransformer extends Object implements Lookup, org.apache.commons.collections.Transformer, AccessorLookUp
key
) fetch the value using the input as a key OR For a passed in Map, lookup a KeykeyTransformer
on the key to derive the final key value to do the lookup.Constructor and Description |
---|
MapValueLookupTransformer() |
MapValueLookupTransformer(Object key) |
Modifier and Type | Method and Description |
---|---|
Object |
get(Object entity,
Object key) |
Object |
getKey()
A key value or a
Map |
org.apache.commons.collections.Transformer |
getKeyTransformer()
Key Transformer
|
org.apache.commons.collections.Transformer |
getNoKeyReturn()
If while looking up, the final generated or passed key does not exist in the Map, then apply this over the input.
If null (by default), will return null. |
org.apache.commons.collections.Transformer |
getTransformer()
Value Transformer
|
void |
setKey(Object key)
A key value or a
Map |
void |
setKeyTransformer(org.apache.commons.collections.Transformer keyTransformer)
Key Transformer
|
void |
setNoKeyReturn(org.apache.commons.collections.Transformer noKeyReturn)
If while looking up, the final generated or passed key does not exist in the Map, then apply this over the input.
If null (by default), will return null. |
void |
setTransformer(org.apache.commons.collections.Transformer transformer)
Value Transformer
|
Object |
transform(Object input)
For a Given String, Lookup a value for it
|
public MapValueLookupTransformer()
public MapValueLookupTransformer(Object key)
public Object transform(Object input)
Lookup
public Object get(Object entity, Object key) throws Exception
get
in interface AccessorLookUp
entity
- as Entity to be looked upkey
- to lookup the entityException
public org.apache.commons.collections.Transformer getTransformer()
public void setTransformer(org.apache.commons.collections.Transformer transformer)
public org.apache.commons.collections.Transformer getKeyTransformer()
public void setKeyTransformer(org.apache.commons.collections.Transformer keyTransformer)
public org.apache.commons.collections.Transformer getNoKeyReturn()
public void setNoKeyReturn(org.apache.commons.collections.Transformer noKeyReturn)
Copyright © 2018. All rights reserved.