public class FileToProductsTransformer<P extends Product> extends EventAwareProcess implements SourceAware, org.apache.commons.collections.Transformer
ModeAware.getMode() is Mode.UPDATE and the FacetMeta.isCollectionType() then it will append existing data
instead of replacing it.
Transformer
SourceAware and hence ModeAware.
TODO: Add unit test caseProcess.Event, Process.EventPoint| Modifier and Type | Field and Description |
|---|---|
protected FacetMeta |
contentFacet
The
FacetMeta in the Content the file will relate to |
protected Lookup |
entitiesLookup
Uses this as to extract the entities (List) from the raw input type, that relate to the input
|
protected org.apache.commons.collections.Predicate |
filter
Filter Raw input and ensure its eligible for Transformation
|
protected Mode |
mode |
protected List<Mode> |
modesSupported
What all modes does this Reader support
Default All defined in Mode |
protected boolean |
order
If true then order the file names in case an array is used
|
protected org.apache.commons.collections.Transformer |
pathTransformer
For the given File/resource; derive the appropriate path to the resource
|
protected boolean |
unique
If true then file names are unique in case an array is used
|
listeners, processState| Constructor and Description |
|---|
FileToProductsTransformer() |
| Modifier and Type | Method and Description |
|---|---|
FacetMeta |
getContentFacet()
The
FacetMeta in the Content the file will relate to |
Lookup |
getEntitiesLookup()
Uses this as to extract the entities (List) from the raw input type, that relate to the input
|
org.apache.commons.collections.Predicate |
getFilter()
Filter Raw input and ensure its elegible for
Transformeration |
Mode |
getMode()
The processing logic of the Reader may differ based n the fact it is intended to Update or Insert or Delete
|
List<Mode> |
getModesSupported()
Get the
Modes supported by the instance |
org.apache.commons.collections.Transformer |
getPathTransformer()
For the given File/resource; derive the appropriate path to the resource
|
boolean |
isOrder()
If true then order the file names in case an array is used
|
boolean |
isUnique()
If true then file names are unique in case an array is used
|
void |
setContentFacet(FacetMeta contentFacet)
The
FacetMeta in the Content the file will relate to |
void |
setEntitiesLookup(Lookup entitiesLookup)
Uses this as to extract the entities (List) from the raw input type, that relate to the input
|
void |
setFilter(org.apache.commons.collections.Predicate filter)
Filter Raw input and ensure its elegible for
Transformeration |
void |
setMode(Mode mode) |
void |
setModesSupported(List<Mode> modesSupported) |
void |
setOrder(boolean order)
If true then order the file names in case an array is used
|
void |
setPathTransformer(org.apache.commons.collections.Transformer pathTransformer)
For the given File/resource; derive the appropriate path to the resource
|
void |
setUnique(boolean unique)
If true then file names are unique in case an array is used
|
Object |
transform(Object input) |
protected String |
updateList(String existingAttributeValue)
The list of file names for a given product.
|
addListener, getListeners, onChangeHandler, setListenersprotected Mode mode
protected org.apache.commons.collections.Predicate filter
protected Lookup entitiesLookup
protected org.apache.commons.collections.Transformer pathTransformer
protected boolean order
protected boolean unique
protected String updateList(String existingAttributeValue)
order is true then it is sortedlist - @Transactional(readOnly=false) public Object transform(Object input)
transform in interface org.apache.commons.collections.Transformerpublic Mode getMode()
ModeAwaregetMode in interface ModeAwareModeMode.UPDATEpublic void setMode(Mode mode)
setMode in interface ModeAwareMode.UPDATEpublic org.apache.commons.collections.Predicate getFilter()
Transformerationpublic void setFilter(org.apache.commons.collections.Predicate filter)
Transformerationpublic Lookup getEntitiesLookup()
public void setEntitiesLookup(Lookup entitiesLookup)
public FacetMeta getContentFacet()
FacetMeta in the Content the file will relate topublic void setContentFacet(FacetMeta contentFacet)
FacetMeta in the Content the file will relate topublic org.apache.commons.collections.Transformer getPathTransformer()
public void setPathTransformer(org.apache.commons.collections.Transformer pathTransformer)
public List<Mode> getModesSupported()
ModeAwareModes supported by the instancegetModesSupported in interface ModeAwarepublic boolean isOrder()
public void setOrder(boolean order)
public boolean isUnique()
public void setUnique(boolean unique)
Copyright © 2018. All rights reserved.