public class CatalogEntryAttributeFilter extends java.lang.Object implements Filter
CatalogEntryAttributeFilter
class filters LineItemSet based on
CatalogEntry
attribute values of the LineItems. It returns all
LineItem
whose attribute value satisfies the defined matching
rule. This class implements Filter
interface.
XML Snippet for this type of Filter
.
<Filter impl="com.ibm.commerce.marketing.promotion.condition.CatalogEntryAttributeFilter"> <AssociatedLanguage>-1</AssociatedLanguage> <CaseSensitive>false</CaseSensitive> <SupportAttributeWithNoAssociatedLanguage>false</SupportAttributeWithNoAssociatedLanguage> <AttributeRule> <Name>Color</Name> <MatchingType>EqualTo</MatchingType> <Value>Blue</Value> <Value>Red</Value> </AttributeRule> <AttributeRule> <Name>Size</Name> <MatchingType>GreaterThan</MatchingType> <Value>12</Value> </AttributeRule> </Filter>
Modifier and Type | Class and Description |
---|---|
class |
CatalogEntryAttributeFilter.AttributeRule
A class that represents the attribute matching rule.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
static int |
MATCH_RESULT_FALSE
A constant indicates that the attribute value does not match the rule.
|
static int |
MATCH_RESULT_TRUE
A constant indicates that the attribute value matches the rule.
|
static int |
MATCH_RESULT_UNKNOWN
A constant indicates that the matching rule is not currently supported.
|
static java.lang.String |
TAG_ATTR_RULE
XML tag - "AttributeRule"
|
static java.lang.String |
TAG_CASE_SENSITIVE
XML tag - "CaseSensitive"
|
static java.lang.String |
TAG_FILTER
XML tag - "Filter"
|
static java.lang.String |
TAG_INCLUSION
XML tag - "Inclusion"
|
static java.lang.String |
TAG_LANGUAGE
XML tag - "AssociatedLanguage"
|
static java.lang.String |
TAG_SUPPORT_NONE_LANGUAGE
XML tag - "SupportAttributeWithNoAssociatedLanguage"
|
Constructor and Description |
---|
CatalogEntryAttributeFilter()
Constructor for CatalogEntryAttributeFilter.
|
Modifier and Type | Method and Description |
---|---|
LineItemSet |
filter(LineItemSet input,
PromotionContext context)
This method performs the business logic to filter the input LineItemSet
and return a subset of the original LineItemSet.
|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.lang.String |
getAssociatedLanguage()
Gets the language used for the attribute matching rules.
|
java.util.List |
getAttributeRules()
Gets list of attribute matching rules.
|
boolean |
isCaseSensitive()
Gets the flag indicating whether the name or value of an attribute is
case-sensitive or not.
|
boolean |
isInclusion()
Gets the flag indicating whether the filtering logic is for inclusion or
exclusion.
|
boolean |
isSupportAttributeWithNoAssociatedLanguage()
A flag indicates whether the filter will support attributes that does not
have associated language.
|
void |
setAssociatedLanguage(java.lang.String aLanguageId)
Sets the language used for attribute rules.
|
void |
setCaseSensitive(boolean aCaseSensitive)
Sets the case-sensitive flag that indicates whether the value of an
attribute is case-sensitive or not.
|
void |
setInclusion(boolean aInclusion)
Sets the flag to indicate whether the filtering logic is for inclusion or
exclusion.
|
void |
setSupportAttributeWithNoAssociatedLanguage(boolean aFlag)
Sets the flag that indicates whether the filter will support language
insensitive attributes or not.
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String TAG_FILTER
public static final java.lang.String TAG_LANGUAGE
public static final java.lang.String TAG_INCLUSION
public static final java.lang.String TAG_SUPPORT_NONE_LANGUAGE
public static final java.lang.String TAG_CASE_SENSITIVE
public static final java.lang.String TAG_ATTR_RULE
public static final int MATCH_RESULT_TRUE
public static final int MATCH_RESULT_FALSE
public static final int MATCH_RESULT_UNKNOWN
public CatalogEntryAttributeFilter()
public java.util.List getAttributeRules()
public LineItemSet filter(LineItemSet input, PromotionContext context)
Filter
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
anXMLNode
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public java.lang.String getAssociatedLanguage()
public void setAssociatedLanguage(java.lang.String aLanguageId)
aLanguageId
- The language ID to set.public boolean isSupportAttributeWithNoAssociatedLanguage()
public void setSupportAttributeWithNoAssociatedLanguage(boolean aFlag)
aFlag
- The value of true or false.public boolean isCaseSensitive()
public void setCaseSensitive(boolean aCaseSensitive)
aCaseSensitive
- The value to set.public boolean isInclusion()
public void setInclusion(boolean aInclusion)
aInclusion
- The value to set.