public class AdjustmentFunction extends java.lang.Object implements XMLizable
AdjustmentFunction
class encapsulates Adjustment
and
the list of Filter
for that particular adjustment. AdjustmentFunction
is defined by a set of filters and an Adjustment.
This is the XML Snippet for AdjustmentFunction
:
<AdjustmentFunction impl="com.ibm.commerce.marketing.promotion.reward.AdjustmentFunction"> <FilterChain impl="com.ibm.commerce.marketing.promotion.condition.FilterChain"> <!-- Multiple Filters can be specified --> <Filter></Filter> </FilterChain> <Adjustment></Adjustment> </AdjustmentFunction>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
AdjustmentFunction()
Constructor for AdjustmentFunction.
|
Modifier and Type | Method and Description |
---|---|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
Adjustment |
getAdjustment()
This method gets the
Adjustment of this AdjustmentFunction. |
FilterChain |
getFilterChain()
This method gets the
FilterChain for this AdjustmentFunction. |
boolean |
invoke(LineItemSet targetedItems,
java.math.BigDecimal targetedAmount,
int targetedAmountTypes,
java.util.Vector affectedItemsVector,
java.util.Vector adjustmentsVector,
PromotionContext context)
This method gets the filter list of the adjustment function and applies
all the filters to the targeted order items to obtain the affected order
items.
|
void |
setAdjustment(Adjustment newAdjustment)
This method sets the
Adjustment for this AdjustmentFunction. |
void |
setFilterChain(FilterChain _filterChain)
This method sets the
FilterChain for this AdjustmentFunction. |
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public AdjustmentFunction()
public Adjustment getAdjustment()
Adjustment
of this AdjustmentFunction.Adjustment
public FilterChain getFilterChain()
FilterChain
for this AdjustmentFunction.FilterChain
public void setAdjustment(Adjustment newAdjustment)
Adjustment
for this AdjustmentFunction.newAdjustment
- Adjustment
public void setFilterChain(FilterChain _filterChain)
FilterChain
for this AdjustmentFunction._filterChain
- The FilterChain
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 boolean invoke(LineItemSet targetedItems, java.math.BigDecimal targetedAmount, int targetedAmountTypes, java.util.Vector affectedItemsVector, java.util.Vector adjustmentsVector, PromotionContext context) throws PromotionRuntimeException
Adjustment
associated with this AdjusmentFunction and returns
the boolean value returned by the apply method. This method is called in
the computeReward(PromotionContext, PromotionExecutionRecord) method of
DefaultReward
.targetedItems
- The targeted order items. This is a set of order items (or
portions of order items) that are used to qualify for the
promotion of which the Adjustment associated with the
AdjustmentFunction is a part.targetedAmount
- Targeted amount.targetedAmountTypes
- Type of the Targeted amount.affectedItemsVector
- A Vector of affected LineItemSets.adjustmentsVector
- A Vector of Adjustment objects.context
- The PromotionContext.PromotionRuntimeException
- when the computation encounters a problem.