public class EntityProcessorWrapper extends EntityProcessor
EntityProcessor
instance which performs transforms and handles multi-row outputs correctly.Modifier and Type | Field and Description |
---|---|
protected VariableResolverImpl |
resolver |
protected List<Map<String,Object>> |
rowcache |
protected List<Transformer> |
transformers |
Constructor and Description |
---|
EntityProcessorWrapper(EntityProcessor delegate,
DocBuilder docBuilder) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
applyTransformer(Map<String,Object> row)
handles null-on-null invocation
call transformers via
transformRow(java.util.Map<java.lang.String, java.lang.Object>) , then assigns the result into row cache, and delegates to getFromRowCache() |
void |
close()
Invoked when the Entity processor is destroyed towards the end of import.
|
void |
destroy()
Invoked for each parent-row after the last row for this entity is processed.
|
Context |
getContext() |
protected Map<String,Object> |
getFromRowCache() |
VariableResolverImpl |
getVariableResolver() |
void |
init(Context context)
This method is called when it starts processing an entity.
|
Map<String,Object> |
nextDeletedRowKey()
This is used during delta-import.
|
Map<String,Object> |
nextModifiedParentRowKey()
This is used during delta-import.
|
Map<String,Object> |
nextModifiedRowKey()
This is used for delta-import.
|
Map<String,Object> |
nextRow()
for root entity it retrieves single row, transforms it,
and loop until transfomer passes the first row
for child entities whole page is pulled. where the page is non-null children entity rows.
|
protected Map<String,Object> |
pullRow()
pulls single row from the delegate EntityProcessor.
|
protected List<Map<String,Object>> |
transformRow(Map<String,Object> row)
Initialises transformers, applies them on the given row. returned collection is mutable
|
postTransform
protected VariableResolverImpl resolver
protected List<Transformer> transformers
public EntityProcessorWrapper(EntityProcessor delegate, DocBuilder docBuilder)
public void init(Context context)
EntityProcessor
init
in class EntityProcessor
context
- The current contextprotected Map<String,Object> applyTransformer(Map<String,Object> row)
transformRow(java.util.Map<java.lang.String, java.lang.Object>)
, then assigns the result into row cache, and delegates to getFromRowCache()
protected List<Map<String,Object>> transformRow(Map<String,Object> row)
public Map<String,Object> nextRow()
nextRow
in class EntityProcessor
protected Map<String,Object> pullRow()
public Map<String,Object> nextModifiedRowKey()
EntityProcessor
nextModifiedRowKey
in class EntityProcessor
public Map<String,Object> nextDeletedRowKey()
EntityProcessor
nextDeletedRowKey
in class EntityProcessor
public Map<String,Object> nextModifiedParentRowKey()
EntityProcessor
nextModifiedParentRowKey
in class EntityProcessor
public void destroy()
EntityProcessor
destroy
in class EntityProcessor
public VariableResolverImpl getVariableResolver()
public Context getContext()
public void close()
EntityProcessor
close
in class EntityProcessor