Overview | Package | Class | Tree | Deprecated | Index | Help
| 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

## com.bea.p13n.rules.model
Class RuleModel

    java.lang.Object
      com.bea.p13n.model.Model
          com.bea.p13n.model.XmlObjectModel
              com.bea.p13n.rules.model.ClauseModel
                  com.bea.p13n.rules.model.RuleModel

All Implemented Interfaces
  BoundVariableProvider, Serializable, Cloneable

    public class RuleModel

extends ClauseModel
implements BoundVariableProvider

The model representing an rule.

This will always have 2 children, in order, a `ConditionsModel` and a `ActionsModel`. Those will contain the various ClauseModels of the rule.

The clauseType of a RuleModel will be its ruleType identifier. It will kept uptodate with the actions. Therefore, adding and removing clauses from the conditions and actions will possibly fire 'clauseType' change events.

See Also
  Serialized Form

Nested Class Summary
`static class` | `RuleModel.ActionsModel` A clause model to hold the action clauses of the rule.
`static class` | `RuleModel.ConditionsModel` A clause model to hold the condition clauses of the rule.
`static class` | `RuleModel.Recongizer` An object which recognizes Xmlobjects that can be loaded into a RuleModel.

Nested classes/interfaces inherited from class com.bea.p13n.model.Model
`Model.ChangeEvent, Model.ChangeListener, Model.ChangeSupport, Model.Debug`

Field Summary
`static String` | `GENERIC_RULE_TYPE`

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
`RuleModel()`

Method Summary
`void` | `clearCachedData()` Clear out any cached data where holding so we'll get it from the `Rule` next time.
`org.apache.xmlbeans.XmlObject` | `createNewXmlObject(String clauseType)` Return a new, empty Rule object with no conditions or actions.
`protected void` | `determineClauseType()` Update our clauseType to be the ruleType.
`protected boolean` | `determineIsComplete()` Determine if the RuleModel is currently complete.
`RuleModel.ActionsModel` | `getActionsModel()` Get the actions.
`Collection<MethodCallModel.VariableArgument>` | `getBoundVariables()` Return the name/type pairs of all variables bound into the rule conditions.
`RuleModel.ConditionsModel` | `getConditionsModel()` Get the conditions.
`String` | `getDescription()` Get the rule description.
`String` | `getName()` Get the rule name.
`com.bea.p13n.rules.schema.RuleDocument.Rule` | `getRule()` Get the underlying Rule object.
`void` | `setDescription(String desc)` Set the rule description.
`protected void` | `setIsComplete(boolean isComplete)` Override to set on our `rule` object also.
`void` | `setName(String name)` Set the rule name.
`void` | `setXmlObject(String clauseType, org.apache.xmlbeans.XmlObject clause)` Initialize this model from the specified clause structure.

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, 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

### GENERIC_RULE_TYPE

    public static final String GENERIC_RULE_TYPE

See Also
  Constants Summary

Constructor Detail

### RuleModel

    public RuleModel()

Method Detail

### setXmlObject

    public void setXmlObject(String clauseType,
                             org.apache.xmlbeans.XmlObject clause)
                      throws IllegalArgumentException

  Initialize this model from the specified clause structure.

  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 a `RuleDocument.Rule` instance.

### determineClauseType

    protected void determineClauseType()

  Update our clauseType to be the ruleType.

### createNewXmlObject

    public org.apache.xmlbeans.XmlObject createNewXmlObject(String clauseType)

  Return a new, empty Rule object with no conditions or actions.

  Specified by:
    `createNewXmlObject` in class `ClauseModel`
  Parameters
    `clauseType` - the clause type of the clause.
  Returns
    a new, empty initialize root object.

### clearCachedData

    public void clearCachedData()

  Clear out any cached data where holding so we'll get it from the `Rule` next time.

  Specified by:
    `clearCachedData` in class `XmlObjectModel`

### getRule

    public com.bea.p13n.rules.schema.RuleDocument.Rule getRule()

  Get the underlying Rule object.

### setIsComplete

    protected void setIsComplete(boolean isComplete)

  Override to set on our `rule` object also.

  Overrides:
    `setIsComplete` in class `XmlObjectModel`

### determineIsComplete

    protected boolean determineIsComplete()

  Determine if the RuleModel is currently complete. RuleModels are complete if:
  - they have a name.
  - they have at least one action.
  - all action and condition clauses are complete.

  Overrides:
    `determineIsComplete` in class `XmlObjectModel`

### getName

    public String getName()

  Get the rule name. This will never be null; it will be empty string for no name or if not set.

### setName

    public void setName(String name)

  Set the rule name.

### getDescription

    public String getDescription()

  Get the rule description.

  Returns
    the description, or null if none.

### setDescription

    public void setDescription(String desc)

  Set the rule description.

### getBoundVariables

    public Collection<MethodCallModel.VariableArgument> getBoundVariables()

  Return the name/type pairs of all variables bound into the rule conditions. These can then be referenced in the rule actions. The resulting list can be modified; it will be recreate with each call.

  Specified by:
    `getBoundVariables` in interface `BoundVariableProvider`
  Returns
    the bound variable information, null or empty for none.

### getConditionsModel

    public RuleModel.ConditionsModel getConditionsModel()

  Get the conditions.

### getActionsModel

    public RuleModel.ActionsModel getActionsModel()

  Get the actions.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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.