public class CategoryFilter extends java.lang.Object implements Filter
CategoryFilter
class filters LineItemSet
based on the
Categories to which the AssociatedOrderItem
(of the LineItemSet)
belong to. It returns all the AssociatedOrderItems which belong to categories
in InclusionCategory
list and doesn't belong to categories in
ExclusionCategory
list. This class implements Filter
interface. XML snippet for this type of Filter
.
<Filter impl="com.ibm.commerce.marketing.promotion.condition.CategoryFilter"> <IncludeCategory> <CategoryKey> <DN>Root Organization</DN> <Name>Pants</Name> </CategoryKey> </IncludeCategory> <ExcludeCategory> <CategoryKey> <DN>Root Organization</DN> <Name>Sweaters</Name> </CategoryKey> </ExcludeCategory> </Filter>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
CategoryFilter()
Constructor for
CategoryFilter . |
Modifier and Type | Method and Description |
---|---|
void |
addToExclusionList(CategoryKey key)
This method adds the
CategoryKey to the exclusion category
list. |
void |
addToExclusionList(java.lang.String aDN,
java.lang.String name)
This method adds the
CategoryKey identified by it's
DN and Identifier to the Exclusion CategoryList. |
void |
addToInclusionList(CategoryKey key)
This method adds the
CategoryKey to the inclusion category
list. |
void |
addToInclusionList(java.lang.String aDN,
java.lang.String name)
This method adds the
CategoryKey identified by it's
DN and Identifier , to the inclusion category
list. |
boolean |
belongsToExclusionList(CategoryKey key)
This method checks if
CategoryKey belongs to the exclusion
category list. |
boolean |
belongsToExclusionList(java.lang.String aDN,
java.lang.String name)
This method checks if
CategoryKey identified by it's
DN and identifier belongs to the exclusion category list. |
boolean |
belongsToInclusionList(CategoryKey key)
This method checks if
CategoryKey belongs to the inclusion
category list. |
boolean |
belongsToInclusionList(java.lang.String aDN,
java.lang.String name)
This method checks if
CategoryKey identified by it's
DN and identifier belongs to the inclusion category list. |
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.
|
CategoryKey[] |
getExclusionList()
This method gets the list of
CategoryKey in the exclusion
category list. |
CategoryKey[] |
getInclusionList()
This method gets the list of
CategoryKey in the inclusion
category list. |
void |
removeFromExclusionList(CategoryKey key)
This method removes the
CategoryKey from the exclusion
category list. |
void |
removeFromExclusionList(java.lang.String aDN,
java.lang.String name)
This method removes the
CategoryKey identified by it's
DN and identifier from the exclusion category list. |
void |
removeFromInclusionList(CategoryKey key)
This method removes the
CategoryKey from the inclusion
category list. |
void |
removeFromInclusionList(java.lang.String aDN,
java.lang.String name)
This method removes the
CategoryKey identified by it's
DN and identifier from the inclusion category list. |
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public CategoryKey[] getInclusionList()
CategoryKey
in the inclusion
category list.CategoryKey
public CategoryKey[] getExclusionList()
CategoryKey
in the exclusion
category list.CategoryKey
public void addToInclusionList(java.lang.String aDN, java.lang.String name)
CategoryKey
identified by it's
DN
and Identifier
, to the inclusion category
list. This method is invoked in the fromXML(Node)
method during
transformation of the passed XML Node to the CategoryFilter object.aDN
- The DN
of the categoryname
- The Identifier
of the categorypublic void addToInclusionList(CategoryKey key)
CategoryKey
to the inclusion category
list. This method is invoked in the fromXML(Node)
method during
transformation of the passed XML Node to the CategoryFilter object.key
- CategoryKey
public void addToExclusionList(java.lang.String aDN, java.lang.String name)
CategoryKey
identified by it's
DN
and Identifier to the Exclusion CategoryList. This method
is invoked in the fromXML(Node)
method during transformation of
the passed XML Node to the CategoryFilter object.aDN
- The DN
of the categoryname
- The identifier of the categorypublic void addToExclusionList(CategoryKey key)
CategoryKey
to the exclusion category
list. This method is invoked in the fromXML(Node)
method during
transformation of the passed XML Node to the CategoryFilter object.key
- CategoryKey
public void removeFromExclusionList(java.lang.String aDN, java.lang.String name)
CategoryKey
identified by it's
DN
and identifier from the exclusion category list.aDN
- The DN
of the categoryname
- The identifier of the categorypublic void removeFromExclusionList(CategoryKey key)
CategoryKey
from the exclusion
category list.key
- CategoryKey
public void removeFromInclusionList(java.lang.String aDN, java.lang.String name)
CategoryKey
identified by it's
DN
and identifier from the inclusion category list.aDN
- The DN
of the categoryname
- The identifier of the categorypublic void removeFromInclusionList(CategoryKey key)
CategoryKey
from the inclusion
category list.key
- CategoryKey
public boolean belongsToInclusionList(java.lang.String aDN, java.lang.String name)
CategoryKey
identified by it's
DN
and identifier belongs to the inclusion category list.aDN
- The DN
of the categoryname
- The identifier of the categorytrue
if belongs to inclusion list,
false
otherwise;public boolean belongsToInclusionList(CategoryKey key)
CategoryKey
belongs to the inclusion
category list.key
- CategoryKey
true
if belongs to inclusion list,
false
otherwise;public boolean belongsToExclusionList(java.lang.String aDN, java.lang.String name)
CategoryKey
identified by it's
DN
and identifier belongs to the exclusion category list.aDN
- The DN
of the categoryname
- The identifier of the categorytrue
if belongs to exclusion list,
false
otherwise;public boolean belongsToExclusionList(CategoryKey key)
CategoryKey
belongs to the exclusion
category list.key
- CategoryKey
true
if belongs to exclusion list,
false
otherwise;public LineItemSet filter(LineItemSet input, PromotionContext context)
Filter
filter
in interface Filter
input
- LineItemSet
context
- PromotionContext
LineItemSet
Filter.filter(LineItemSet,
PromotionContext)
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)