com.elasticpath.domain.rules.impl
Class AbstractRuleExceptionImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractValueObjectImpl
              extended by com.elasticpath.domain.rules.impl.AbstractRuleExceptionImpl
All Implemented Interfaces:
EpDomain, Persistence, RuleException, ValueObject, java.io.Serializable
Direct Known Subclasses:
CategoryExceptionImpl, ProductExceptionImpl, SkuExceptionImpl

public abstract class AbstractRuleExceptionImpl
extends AbstractValueObjectImpl
implements RuleException

Abstract class with behaviour common to all rule elements.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
AbstractRuleExceptionImpl()
           
 
Method Summary
 void addParameter(RuleParameter ruleParameter)
          Add a parameter of this rule condition.
 java.util.Set getParameters()
          Get the parameters associated with this rule condition.
 java.lang.String getParamValue(java.lang.String key)
          Returns the value of a parameter with the specified key.
 java.lang.String getType()
          Get the type of this RuleException.
 void setDefaultValues()
          Sets default values.
 void setParameters(java.util.Set parameters)
          Set the parameters of this rule condition.
 void setType(java.lang.String type)
          Set the type of element.
 void validate()
          Checks that the rule set domain model is well formed.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.rules.RuleException
appliesInScenario, getDisplayText, getParameterKeys
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

AbstractRuleExceptionImpl

public AbstractRuleExceptionImpl()
Method Detail

addParameter

public void addParameter(RuleParameter ruleParameter)
Add a parameter of this rule condition.

Specified by:
addParameter in interface RuleException
Parameters:
ruleParameter - a RuleParameter object

getParameters

public java.util.Set getParameters()
Get the parameters associated with this rule condition.

Specified by:
getParameters in interface RuleException
Returns:
the parameters

getParamValue

public java.lang.String getParamValue(java.lang.String key)
Returns the value of a parameter with the specified key.

Specified by:
getParamValue in interface RuleException
Parameters:
key - The key of the parameter to be returned
Returns:
the value of the parameter with the specified key or "" if no matching parameter was found.

getType

public java.lang.String getType()
Get the type of this RuleException. (e.g. skuException. Should match spring bean factory bean id.)

Specified by:
getType in interface RuleException
Returns:
the type

setDefaultValues

public void setDefaultValues()
Sets default values.

Specified by:
setDefaultValues in interface Persistence
Overrides:
setDefaultValues in class AbstractPersistenceImpl

setParameters

public void setParameters(java.util.Set parameters)
Set the parameters of this rule condition.

Specified by:
setParameters in interface RuleException
Parameters:
parameters - a set of RuleParameter objects

setType

public void setType(java.lang.String type)
Set the type of element. (e.g. skuException. Should match bean name)

Specified by:
setType in interface RuleException
Parameters:
type - the type of element

validate

public void validate()
              throws EpDomainException
Checks that the rule set domain model is well formed. For example, rule conditions must have all required parameters specified.

Specified by:
validate in interface RuleException
Throws:
EpDomainException - if the structure is not correct.