public class ProductNameTransformer<T extends Product> extends UsesIntermediateObjectImpl implements org.apache.commons.collections.Transformer
Product.getProductCode()
to ensure it is unique.
Product.getName()
is used @ a lot of places on client side for referring to products on server,
so once set this adapter or any of its relations should not be modified for that projectModifier and Type | Field and Description |
---|---|
static String |
PRODUCT_NAME_CLEAN_REGEX |
intermediateResults, resultNamesUsed, resultsThatAreOptional
Constructor and Description |
---|
ProductNameTransformer() |
Modifier and Type | Method and Description |
---|---|
String |
getCleanup_regex_str() |
String |
getInterpart_delimiter()
A product can be identified by Name, SKU etc.
|
String |
getIntrapart_delimiter()
A product name or part can have several words; so what is the delimited to be used between the words of the same part.
|
void |
init() |
protected boolean |
isNameCharSetSafe(T product)
If true it will not attempt to make the name safe, if not then it will make the name safe.
This checks if the characters used are in safe character set (default defined by cleanup_regex_str |
boolean |
isToLower()
If true will ensure all names are in lower case for consistency
|
void |
setCleanup_regex_str(String cleanup_regex_str) |
void |
setInterpart_delimiter(String interpart_delimiter)
A product can be identified by Name, SKU etc.
|
void |
setIntrapart_delimiter(String intrapart_delimiter)
A product name or part can have several words; so what is the delimited to be used between the words of the same part.
|
void |
setToLower(boolean toLower)
If true will ensure all names are in lower case for consistency
|
Object |
transform(Object input) |
determineInput, getInputFromContext, getInterMediateResults, getResultNamesThatAreOptional, getResultNamesUsed, setIntermediateResults, setResultNamesThatAreOptional, setResultNamesUsed
public static final String PRODUCT_NAME_CLEAN_REGEX
@PostConstruct public void init()
protected boolean isNameCharSetSafe(T product)
cleanup_regex_str
public Object transform(Object input)
transform
in interface org.apache.commons.collections.Transformer
public String getInterpart_delimiter()
public void setInterpart_delimiter(String interpart_delimiter)
public String getIntrapart_delimiter()
public void setIntrapart_delimiter(String intrapart_delimiter)
public String getCleanup_regex_str()
public void setCleanup_regex_str(String cleanup_regex_str)
public boolean isToLower()
public void setToLower(boolean toLower)
Copyright © 2018. All rights reserved.