public class ContextExtractorTransformer extends Object implements FunctionTransformer, Map
Map
or ContextMapperTransformer
using the mapper
's Mapper.getFieldName()
or Mapper.getBehavior(Class)
IntermediateResultMapperBehavior
Constructor and Description |
---|
ContextExtractorTransformer() |
ContextExtractorTransformer(Mapper mapper,
Map context) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set |
entrySet() |
Object |
get(Object key)
Get
context .mapper
Or Get context .key if mapper is null
Or Get context .mapper .contextObjectAccessor on Key; if contextObjectAccessor is not null
Or Get context .key.contextObjectAccessor on Key; if contextObjectAccessor is not null |
Map |
getContext()
An existing context
|
AccessorLookUp |
getContextObjectAccessor()
If null, the Object from the
context will be retrieved using the mapper If Not null then the input to the transform(Object) will act as an accessor in an EntityChainAccessTransformer |
Mapper |
getMapper()
The mapper to reverse-map / extract the value from the Context
If the mapper is not specified then the input is used as a key |
boolean |
isEmpty() |
Set |
keySet() |
Object |
put(Object key,
Object value) |
void |
putAll(Map m) |
Object |
remove(Object key) |
void |
setContext(Map context)
An existing context
|
void |
setContextObjectAccessor(AccessorLookUp contextObjectAccessor)
If null, the Object from the
context will be retrieved using the mapper If Not null then the input to the transform(Object) will act as an accessor in an EntityChainAccessTransformer |
void |
setMapper(Mapper mapper)
The mapper to reverse-map / extract the value from the Context
If the mapper is not specified then the input is used as a key |
int |
size() |
Object |
transform(Object key)
Get
context .mapper
Or Get context .key if mapper is null
Or Get context .mapper .contextObjectAccessor on Key; if contextObjectAccessor is not null
Or Get context .key.contextObjectAccessor on Key; if contextObjectAccessor is not null |
Collection |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public Object transform(Object key)
context
.mapper
Or context
.key if mapper
is null
Or context
.mapper
.contextObjectAccessor
on Key; if contextObjectAccessor is not null
Or context
.key.contextObjectAccessor
on Key; if contextObjectAccessor is not nulltransform
in interface org.apache.commons.collections.Transformer
public Mapper getMapper()
public void setMapper(Mapper mapper)
public Map getContext()
public void setContext(Map context)
public boolean containsKey(Object key)
containsKey
in interface Map
public boolean containsValue(Object value)
containsValue
in interface Map
public Object get(Object key)
context
.mapper
Or context
.key if mapper
is null
Or context
.mapper
.contextObjectAccessor
on Key; if contextObjectAccessor is not null
Or context
.key.contextObjectAccessor
on Key; if contextObjectAccessor is not nullpublic Collection values()
public AccessorLookUp getContextObjectAccessor()
context
will be retrieved using the mapper
transform(Object)
will act as an accessor in an EntityChainAccessTransformer
public void setContextObjectAccessor(AccessorLookUp contextObjectAccessor)
context
will be retrieved using the mapper
transform(Object)
will act as an accessor in an EntityChainAccessTransformer
Copyright © 2018. All rights reserved.