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
Transformer ation |
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
Mode s 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
Transformer ation |
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, setListeners
protected 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.Transformer
public Mode getMode()
ModeAware
getMode
in interface ModeAware
Mode
Mode.UPDATE
public void setMode(Mode mode)
setMode
in interface ModeAware
Mode.UPDATE
public org.apache.commons.collections.Predicate getFilter()
Transformer
ationpublic void setFilter(org.apache.commons.collections.Predicate filter)
Transformer
ationpublic 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()
ModeAware
Mode
s supported by the instancegetModesSupported
in interface ModeAware
public boolean isOrder()
public void setOrder(boolean order)
public boolean isUnique()
public void setUnique(boolean unique)
Copyright © 2018. All rights reserved.