public class ContextMapperTransformer extends HashMap implements FunctionTransformer
#mapper
's Mapper.getFieldName()
or Mapper.getBehavior(Class)
IntermediateResultMapperBehavior
One can use a MapValueLookupTransformer
or the more convenient ContextExtractorTransformer
to extract back a particular context variable from the context Map
.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ContextMapperTransformer() |
ContextMapperTransformer(List<Mapper<org.apache.commons.collections.Transformer>> mappers) |
Modifier and Type | Method and Description |
---|---|
Object |
get(Object key) |
protected Object |
getContext(Object key) |
List<Mapper<org.apache.commons.collections.Transformer>> |
getMappers()
List of
Mapper s that will act on the input to create context variables |
Class<Reference> |
getReferenceType()
The Context can maintain a Strong Reference (null),
WeakReference or SoftReference to the elements in it.Define the class if we explicitly want to dictate the type. Note: If threadSafe is true, it is recommended that the either a WeakReference or a SoftReference be adopted. |
protected Map |
initContext() |
boolean |
isThreadSafe()
If true, ten for each thread a new context is provided
|
Object |
put(Object key,
Object value) |
protected Object |
setContext(Object key,
Object value) |
void |
setMappers(List<Mapper<org.apache.commons.collections.Transformer>> mappers)
List of
Mapper s that will act on the input to create context variables |
void |
setReferenceType(Class<Reference> referenceType)
The Context can maintain a Strong Reference (null),
WeakReference or SoftReference to the elements in it.Define the class if we explicitly want to dictate the type. Note: If threadSafe is true, it is recommended that the either a WeakReference or a SoftReference be adopted. |
void |
setThreadSafe(boolean threadSafe)
If true, ten for each thread a new context is provided
|
Object |
transform(Object input) |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
apply
protected Map initContext()
public Object transform(Object input)
transform
in interface org.apache.commons.collections.Transformer
public List<Mapper<org.apache.commons.collections.Transformer>> getMappers()
Mapper
s that will act on the input to create context variablespublic void setMappers(List<Mapper<org.apache.commons.collections.Transformer>> mappers)
Mapper
s that will act on the input to create context variablespublic boolean isThreadSafe()
public void setThreadSafe(boolean threadSafe)
public Class<Reference> getReferenceType()
WeakReference
or SoftReference
to the elements in it.threadSafe
is true, it is recommended that the either a WeakReference
or a SoftReference
be adopted.public void setReferenceType(Class<Reference> referenceType)
WeakReference
or SoftReference
to the elements in it.threadSafe
is true, it is recommended that the either a WeakReference
or a SoftReference
be adopted.Copyright © 2018. All rights reserved.