public class EntityChainAccessTransformer extends UsesIntermediateObjectImpl implements FunctionTransformer, AccessorLookUp
jsonTransformer is provided.EntityChainAccessModifierTransformer,
ObjectFieldValueTransformer,
Serialized FormintermediateResults, resultNamesUsed, resultsThatAreOptional| Constructor and Description |
|---|
EntityChainAccessTransformer() |
EntityChainAccessTransformer(String accessor) |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(Object entity,
Object key) |
String |
getAccessor()
A string representation in a.b.c format; where any word represents a property as an entity or a map.
|
org.apache.commons.collections.Transformer |
getJsonTransformer()
If provided; will attempt to convert a String intermediate-input in chain; and extract the JSON property directly
Performance Note: Using a JSON transformer for a Field maybe convenient; however it also results in a conversion cost. |
boolean |
isReturnNullOnException()
If a property or value is not found should exceptions be allowed to propagate or mute and return null
|
void |
setAccessor(String accessor)
A string representation in a.b.c format; where any word represents a property as an entity or a map.
|
void |
setJsonTransformer(org.apache.commons.collections.Transformer jsonTransformer)
If provided; will attempt to convert a String intermediate-input in chain; and extract the JSON property directly
Performance Note: Using a JSON transformer for a Field maybe convenient; however it also results in a conversion cost. |
void |
setReturnNullOnException(boolean returnNullOnException)
If a property or value is not found should exceptions be allowed to propagate or mute and return null
|
Object |
transform(Object input) |
Object |
transform(Object input,
String accessor) |
determineInput, getInputFromContext, getInterMediateResults, getResultNamesThatAreOptional, getResultNamesUsed, setIntermediateResults, setResultNamesThatAreOptional, setResultNamesUsedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplypublic EntityChainAccessTransformer()
public EntityChainAccessTransformer(String accessor)
public Object transform(Object input)
transform in interface org.apache.commons.collections.Transformerpublic Object get(Object entity, Object key) throws Exception
get in interface AccessorLookUpentity - as Entity to be looked upkey - to lookup the entitycontext[0] - returnNullOnException @nullable truecontext[1] - jsonTransformer @nullable trueExceptionpublic String getAccessor()
public void setAccessor(String accessor)
public boolean isReturnNullOnException()
public void setReturnNullOnException(boolean returnNullOnException)
public org.apache.commons.collections.Transformer getJsonTransformer()
public void setJsonTransformer(org.apache.commons.collections.Transformer jsonTransformer)
Copyright © 2018. All rights reserved.