public class NullFilter extends Object implements org.apache.commons.collections.Predicate, Lookup, org.apache.commons.collections.Transformer, ChainAware
AbstractEntityTransformer will interpret the null as a BreakChainException or return a null value back in the chain (using ContinueProcessingException)
Transformer then it will throw Exceptions if no defaultValue is used, else on null the defaultValue is returned.
TODO: Add to unit test case JSONNull conditions| Constructor and Description |
|---|
NullFilter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
evaluate(Object object) |
Chain |
getChain()
If the processor that implements this is part of a chain, it will return a reference to the chain else null
|
Object |
getDefaultValue()
In any Transformation or Lookup, if the default value is sent then
instead of null or causing an exception, it will return the default value
|
Object |
getPredecessor()
Get the item before this one in the Chain
|
boolean |
isBlank() |
boolean |
isEmpty() |
boolean |
isThrowException()
If true the filter will reject the record by means of an Exception (not a
BreakChainException), if being used as a Transformer then a ContinueProcessingException will be thrown if true |
void |
setBlank(boolean blank) |
void |
setChain(Chain chain)
If the processor that implements this is part of a chain, it will have a reference to the chain
|
void |
setDefaultValue(Object defaultValue)
In any Transformation or Lookup, if the default value is sent then
instead of null or causing an exception, it will return the default value
|
void |
setEmpty(boolean empty) |
void |
setPredecessor(Object predecessor)
Get the item before this one in the Chain
|
void |
setThrowException(boolean throwException)
If true the filter will reject the record by means of an Exception (not a
BreakChainException), if being used as a Transformer then a ContinueProcessingException will be thrown if true |
Object |
transform(Object input)
For a Given String, Lookup a value for it
|
public boolean evaluate(Object object)
evaluate in interface org.apache.commons.collections.Predicatepublic boolean isEmpty()
public void setEmpty(boolean empty)
public boolean isBlank()
public void setBlank(boolean blank)
public Object transform(Object input)
Lookuppublic void setChain(Chain chain)
ChainAwaresetChain in interface ChainAwarechain - as Chainpublic Chain getChain()
ChainAwaregetChain in interface ChainAwareChainpublic Object getPredecessor()
ChainAwaregetPredecessor in interface ChainAwarepublic void setPredecessor(Object predecessor)
ChainAwaresetPredecessor in interface ChainAwarepublic Object getDefaultValue()
public void setDefaultValue(Object defaultValue)
public boolean isThrowException()
BreakChainException), if being used as a Transformer then a ContinueProcessingException will be thrown if truepublic void setThrowException(boolean throwException)
BreakChainException), if being used as a Transformer then a ContinueProcessingException will be thrown if trueCopyright © 2018. All rights reserved.