public abstract class JoinTransformer<T> extends Object implements FunctionTransformer
Transformer
s result as input in a Serial fashion (order of the List
of Transformer
s provided)
List
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.collections.Predicate |
filter
Filter tokens out if the result is false
|
protected List |
processors
List of processor
Transformer s or type T (direct result), objects |
Constructor and Description |
---|
JoinTransformer() |
JoinTransformer(List processors) |
Modifier and Type | Method and Description |
---|---|
protected T |
cleanDangligngDelimets(T result)
If a
filter is given then there maybe dangling delimiters in the end. |
org.apache.commons.collections.Predicate |
getFilter()
Filter tokens out if the result is false
|
List |
getProcessors() |
protected abstract T |
join(T result,
Object transformedInput)
Join results of type T
|
protected T |
joinDelimet(T result,
Object processor,
boolean hasNext)
In Join operations it maybe desired a delimeter is needed between joins of two
processors in sequence. |
void |
setFilter(org.apache.commons.collections.Predicate filter)
Filter tokens out if the result is false
|
void |
setProcessors(List processors) |
Object |
transform(Object input) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply
protected List processors
Transformer
s or type T (direct result), objectsprotected org.apache.commons.collections.Predicate filter
public JoinTransformer()
public JoinTransformer(List processors)
public List getProcessors()
public void setProcessors(List processors)
protected abstract T join(T result, Object transformedInput) throws ContinueProcessingException
result
- as processors
as a result of a previous join(Object, Object)
or input.transformedInput
- as Object of type T that maybe a literal from the processors
or as a result of transformation from a processor that acts on the main input
ContinueProcessingException
- if we want to ignore the call with the param and continue with the mail processing loop in transform(Object)
protected T joinDelimet(T result, Object processor, boolean hasNext)
processors
in sequence.result
- as T so far of all joinsprocessor
- as type T or Transformer
hasNext
- as boolean (if there are any more processors in the chain). If false the current processor is the last.
Note: If a filter
is defined; hasNext cannot factor the next in the chain will be part of result or not.
However, if there are any dangling delims left cleanDangligngDelimets(Object)
can be defined.protected T cleanDangligngDelimets(T result)
filter
is given then there maybe dangling delimiters in the end.
This method, defines how they can be cleared.result
- public Object transform(Object input)
transform
in interface org.apache.commons.collections.Transformer
public org.apache.commons.collections.Predicate getFilter()
public void setFilter(org.apache.commons.collections.Predicate filter)
Copyright © 2018. All rights reserved.