com.bea.commerce.ebusiness.shoppingcart.model
Class CartContainsSKUModel

java.lang.Object
  extended by com.bea.p13n.model.Model
      extended by com.bea.p13n.model.XmlObjectModel
          extended by com.bea.p13n.rules.model.ClauseModel
              extended by com.bea.commerce.ebusiness.shoppingcart.model.CartContainsSKUModel
All Implemented Interfaces
Serializable, Cloneable

public class CartContainsSKUModel
extends ClauseModel

A clause model to represent if the shopping cart contains a certain quantity of product items based on SKU.

See Also
Serialized Form

Nested Class Summary
static class CartContainsSKUModel.Recognizer
          An object which can recognize CartContainsSKUModel's from xml structure.
 
Nested classes/interfaces inherited from class com.bea.p13n.model.Model
Model.ChangeEvent, Model.ChangeListener, Model.ChangeSupport, Model.Debug
 
Field Summary
static String CLAUSE_TYPE
          The standard clause type for this kind of model.
 
Fields inherited from class com.bea.p13n.rules.model.ClauseModel
clauseType
 
Fields inherited from class com.bea.p13n.model.XmlObjectModel
copyRootXmlObject, instanceUri, isComplete
 
Fields inherited from class com.bea.p13n.model.Model
childrenModels, docModel, parentModel, roChildrenModels
 
Constructor Summary
CartContainsSKUModel()
           
 
Method Summary
 void clearCachedData()
          Clear any cached data.
 org.apache.xmlbeans.XmlObject createNewXmlObject(String clauseType)
          Create a new branch model xml structure.
protected  boolean determineIsComplete()
          This is complete is the quantity is set and there is at least 1 sku specified.
 Number getQuantity()
          Get the quantity of each item being checked for.
 String[] getSKUs()
          Get the product item SKUs this check the quantity of.
 boolean isOrLogic()
          Is this a boolean OR (true) of any of the items matching the quantity, or a boolean AND (false) of all of the items matching the quantity.
 void setOrLogic(boolean orLogic)
          Set the boolean OR logic of this model.
 void setQuantity(Number q)
          Get the quantity of each item being checked for.
 void setSKUs(String[] skus)
          Set the product item SKUs this check the quantity of.
 void setXmlObject(String clauseType, org.apache.xmlbeans.XmlObject clause)
          Set the root xml object for this model.
 
Methods inherited from class com.bea.p13n.rules.model.ClauseModel
addBranch, addLiteral, addMethod, addMethodOrOperator, addOperator, addVariable, addVariableBinding, copy, getClauseType, getContainingRuleModel, getCopyXmlObject, initializeNew, isInActions, isInConditions, isValidTypeAlias, isValidVariableName, makeSafeCopy, toString
 
Methods inherited from class com.bea.p13n.model.XmlObjectModel
checkElement, childAdded, childRemoved, fixQName, getApplicationInstanceUri, getChild, getDocument, getLocalName, getParent, getQName, getRootXmlObject, isComplete, isNil, preRemove, propertyChanged, removeAllChildren, removeChild, setApplicationInstanceUri, setIsComplete, setIsComplete, setParent, setRootXmlObject
 
Methods inherited from class com.bea.p13n.model.Model
addChangeListener, addChild, addChild, clone, doubleEquals, equals, getChildren, getDebug, getDebug, getDocument, getParent, longEquals, removeChangeListener, removeChild, removeChild, removeEmpties, setDocument
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLAUSE_TYPE

public static final String CLAUSE_TYPE
The standard clause type for this kind of model.

See Also
Constants Summary
Constructor Detail

CartContainsSKUModel

public CartContainsSKUModel()
Method Detail

setXmlObject

public void setXmlObject(String clauseType,
                         org.apache.xmlbeans.XmlObject clause)
                  throws IllegalArgumentException
Set the root xml object for this model.

Overrides:
setXmlObject in class ClauseModel
Parameters
clauseType - the clause type of the clause.
clause - the root xml object of the clause.
Throws
IllegalArgumentException - if clause is not of the right structure.

createNewXmlObject

public org.apache.xmlbeans.XmlObject createNewXmlObject(String clauseType)
                                                 throws IllegalArgumentException
Create a new branch model xml structure.

Specified by:
createNewXmlObject in class ClauseModel
Parameters
clauseType - the clause type of the clause.
Returns
a new, empty initialize root object.
Throws
IllegalArgumentException - thrown on an unsupproted clauseType.

clearCachedData

public void clearCachedData()
Clear any cached data.

Specified by:
clearCachedData in class XmlObjectModel

getSKUs

public String[] getSKUs()
Get the product item SKUs this check the quantity of.


setSKUs

public void setSKUs(String[] skus)
Set the product item SKUs this check the quantity of.


getQuantity

public Number getQuantity()
Get the quantity of each item being checked for. The longValue() of the return value will be used.

Returns
the quantity, or null if not set

setQuantity

public void setQuantity(Number q)
Get the quantity of each item being checked for. The longValue() of the parameter will be used.

Parameters
q - the quantity, or null to unset.

isOrLogic

public boolean isOrLogic()
Is this a boolean OR (true) of any of the items matching the quantity, or a boolean AND (false) of all of the items matching the quantity.


setOrLogic

public void setOrLogic(boolean orLogic)
Set the boolean OR logic of this model.

See Also
isOrLogic()

determineIsComplete

protected boolean determineIsComplete()
This is complete is the quantity is set and there is at least 1 sku specified.

Overrides:
determineIsComplete in class XmlObjectModel


Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.