public class MultipleCodesPromotionCodeResolver extends java.lang.Object implements GenericPromotionCodeResolver
MultipleCodesPromotionCodeResolver
class implements the
GenericPromotionCodeResolver
interface and is used to decipher a
promotion code. The Separator element defines the character used to delineate
multiple promotion codes for a promotion. If you are defining a promotion
that accepts multiple codes, separate them using this character. If you would
like to use a different character, define the new character using this
element.XML Snippet of MultipleCodesPromotionCodeResolver is as follows:
<PromotionCodeResolver impl="com.ibm.commerce.marketing.promotion.code.MultipleCodesPromotionCodeResolver"> <Separator>;</Separator> </PromotionCodeResolver>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
MultipleCodesPromotionCodeResolver()
The constructor of MultipleCodesPromotionCodeResolver.
|
Modifier and Type | Method and Description |
---|---|
void |
fromXML(org.w3c.dom.Node node)
Transforms the XML node into its corresponding real Object.
|
java.lang.String |
getSeparator()
This method is used to get the delimiter used to separate different
promotion codes.
|
PromotionKey[] |
resolveCode(java.lang.String promotionCode,
java.util.Hashtable nvp)
This method is used to get the
PromotionKey of the promotions
which have a promotion code same as the passed promotionCode
parameter. |
PromotionKey[] |
resolveCode(java.lang.String promotionCode,
PromotionContext context)
This method is used to get the PromotionKey of the promotions which have
a promotion code same as the passed
promotionCode parameter. |
java.lang.String |
retrievePromotionCode(PromotionKey pKey)
This method is used to retrieve the promotion code for a promotion
identified by its PromotionKey.
|
void |
setSeparator(java.lang.String string)
This method is used to set the delimiter used to separate different
promotion codes.
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public MultipleCodesPromotionCodeResolver()
public java.lang.String retrievePromotionCode(PromotionKey pKey) throws PersistenceObjectReadException, PersistenceObjectNotFoundException
pKey
- key to the promotion for which a promotion code is being
retrieved.PersistenceObjectReadException
- if the an error occurs while reading the promotion objectPersistenceObjectNotFoundException
- if the promotion identified by PromotionKey is not found.public PromotionKey[] resolveCode(java.lang.String promotionCode, PromotionContext context) throws PromotionApplicationException
promotionCode
parameter.resolveCode
in interface GenericPromotionCodeResolver
promotionCode
- The promotion codecontext
- the context within which the resolution is performed.PromotionApplicationException
- when an error is encountered during code resolution.GenericPromotionCodeResolver.resolveCode(String,
PromotionContext)
public PromotionKey[] resolveCode(java.lang.String promotionCode, java.util.Hashtable nvp) throws PromotionApplicationException
PromotionKey
of the promotions
which have a promotion code same as the passed promotionCode
parameter. The nvp
Hashtable is used to obtain additional
properties defined to help with the resolution process of the promotion
code to the promotion, for example the "StoreKey". This method will
lookup the eligible promotions from store path only when current store
does not return any promotion.resolveCode
in interface GenericPromotionCodeResolver
promotionCode
- the promotion codenvp
- custom properties passed to the resolver for promotion code
resolution.PromotionApplicationException
- when an error is encountered during code resolution.GenericPromotionCodeResolver.resolveCode(String,
Hashtable)
public void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
node
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public java.lang.String getSeparator()
public void setSeparator(java.lang.String string)
string
- The delimiter used to separate different codes.