|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.p13n.model.Model com.bea.p13n.model.XmlObjectModel com.bea.campaign.model.ScenarioModel
public class ScenarioModel
A model representing a campaign scenario.
This will have, as children, either
a single RuleSetLink
or
RuleModels
from the embedded
rule-set. Adding a RuleModel as a child to a ScenarioModel with a
RuleSetLink will remove the RuleSetLink and embed a rule-set. Adding a
RuleSetLink as a child to a ScenarioModel with RuleModel children will
remove the RuleModels.
Nested Class Summary | |
---|---|
class |
ScenarioModel.RuleSetLink
An object representing a link to a rule model. |
Nested classes/interfaces inherited from class com.bea.p13n.model.Model |
---|
Model.ChangeEvent, Model.ChangeListener, Model.ChangeSupport, Model.Debug |
Field Summary | |
---|---|
static String |
DOCUMENT_LINK_NS
|
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 | |
---|---|
ScenarioModel()
Default constructor. |
|
ScenarioModel(com.bea.campaign.schema.scenario.ScenarioDocument.Scenario scenario)
Constructor from a Scenario xml object. |
Method Summary | |
---|---|
RuleModel |
addCopyRuleModel(RuleModel rm)
Add a copy of the specified RuleModel to this scenario. |
void |
addRuleModel(RuleModel model)
Add a Rule to the Scenario. |
protected boolean |
childAdded(Model child)
Override to start listening to changes to child rule names. |
protected boolean |
childRemoved(Model child)
Override to stop listening to changes to child rule names. |
void |
clearCachedData()
Clear any cached data this model is holding onto, so that it will recomputed upon next access. |
Model |
copy()
Create a copy of this scenario model. |
org.apache.xmlbeans.XmlObject |
createNewXmlObject()
Create a new, empty scenario xml object. |
protected boolean |
determineIsComplete()
Is this scenario complete? A scenario is complete if: It has a non-empty name All RuleModel children are complete All RuleModel children have unique names |
String |
findUniqueRuleName(RuleModel model)
Find a unique rule name amongst our children RuleModels for the specified RuleModel (using its name as the basis). |
String |
getDescription()
Returns the description of the Scenario. |
String |
getId()
Gets the id of the Scenario. |
String |
getLongDescription()
Returns the long description of the Scenario. |
String |
getName()
Returns the name of the Scenario. |
ScenarioModel.RuleSetLink |
getRuleSetLink()
Get our rule set link, if we have one. |
com.bea.campaign.schema.scenario.ScenarioDocument.Scenario |
getScenario()
Get the Scenario rool xml object. |
String[] |
getValidClassifications()
Get all the names of all the valid classifications for the Scenario. |
boolean |
hasRuleSetLink()
Tell if this scenario is setup with a ScenarioModel.RuleSetLink , instead of
an embeded ruleset and RuleModel children. |
void |
initializeNew()
Initialize this a new, empty scenario. |
boolean |
isActive()
Gets the Scenario's active attribute |
boolean |
isValidClassificationsOrLogic()
Returns if the state of the operator for the valid-classification logic is a boolean "or". |
boolean |
removeRuleModel(int index)
Remove the RuleModel at the specified index. |
boolean |
removeRuleModel(RuleModel rule)
Remove the specified RuleModel child from this scenario. |
void |
setActive(boolean active)
|
static void |
setDataId(org.apache.xmlbeans.XmlObject o,
String id)
Set the data:id attribute on XmlObject. |
void |
setDescription(String newDesc)
Sets the description of the Scenario. |
void |
setId(String newId)
Sets the two id's of the Scenario. |
protected void |
setIsComplete(boolean isComplete)
Override to set on our scenario object also. |
void |
setLongDescription(String newDesc)
Sets the description of the Scenario. |
void |
setName(String newName)
Sets the name of the Scenario. |
void |
setRuleSetLink(ScenarioModel.RuleSetLink link)
Set the RuleSetLink for this scenario. |
void |
setValidClassifications(String... names)
Sets the list of all the names of all the valid classifications for the Scenario. |
void |
setValidClassificationsOrLogic(boolean orLogic)
Sets the value of the operator for the valid-classification tag. |
void |
setXmlObject(org.apache.xmlbeans.XmlObject object)
Set the root xml object for this scenario. |
Methods inherited from class com.bea.p13n.model.XmlObjectModel |
---|
checkElement, fixQName, getApplicationInstanceUri, getChild, getCopyXmlObject, getDocument, getLocalName, getParent, getQName, getRootXmlObject, isComplete, isNil, preRemove, propertyChanged, removeAllChildren, removeChild, setApplicationInstanceUri, 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, toString, wait, wait, wait |
Field Detail |
---|
public static final String DOCUMENT_LINK_NS
Constructor Detail |
---|
public ScenarioModel()
setXmlObject(org.apache.xmlbeans.XmlObject)
or initializeNew()
to enable
this instance.
public ScenarioModel(com.bea.campaign.schema.scenario.ScenarioDocument.Scenario scenario)
Method Detail |
---|
protected boolean childAdded(Model child)
childAdded
in class XmlObjectModel
child
- the child that was added.
XmlObjectModel.setIsComplete(boolean)
protected boolean childRemoved(Model child)
childRemoved
in class XmlObjectModel
child
- the child that was removed.
XmlObjectModel.setIsComplete(boolean)
public void setXmlObject(org.apache.xmlbeans.XmlObject object) throws IllegalArgumentException
object
- the xml object (should be a Scenario).
IllegalArgumentException
- if object isn't valid.public com.bea.campaign.schema.scenario.ScenarioDocument.Scenario getScenario()
public void clearCachedData()
clearCachedData
in class XmlObjectModel
public Model copy()
copy
in class Model
public org.apache.xmlbeans.XmlObject createNewXmlObject()
public void initializeNew()
public String getId()
public void setId(String newId)
public String getName()
public void setName(String newName)
public String getDescription()
public void setDescription(String newDesc)
public String getLongDescription()
public void setLongDescription(String newDesc)
public boolean isActive()
public void setActive(boolean active)
public boolean isValidClassificationsOrLogic()
public void setValidClassificationsOrLogic(boolean orLogic)
public String[] getValidClassifications()
public void setValidClassifications(String... names)
public boolean hasRuleSetLink()
ScenarioModel.RuleSetLink
, instead of
an embeded ruleset and RuleModel children.
public ScenarioModel.RuleSetLink getRuleSetLink()
hasRuleSetLink()
public void setRuleSetLink(ScenarioModel.RuleSetLink link)
the
- new RuleSetLink, or null to clear out the existing
RuleSetLink.public boolean removeRuleModel(RuleModel rule)
public boolean removeRuleModel(int index)
public String findUniqueRuleName(RuleModel model)
RuleSetModel.findUniqueRuleName(Model, RuleModel)
public void addRuleModel(RuleModel model)
RuleSetLink
, it will be
removed.
public RuleModel addCopyRuleModel(RuleModel rm)
addRuleModel(com.bea.p13n.rules.model.RuleModel)
protected void setIsComplete(boolean isComplete)
scenario
object also.
setIsComplete
in class XmlObjectModel
protected boolean determineIsComplete()
determineIsComplete
in class XmlObjectModel
public static void setDataId(org.apache.xmlbeans.XmlObject o, String id)
|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |