ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.rules
Class AbleSwitchRule

java.lang.Object
  extended bycom.ibm.able.rules.AbleRule
      extended bycom.ibm.able.rules.AbleSwitchRule
All Implemented Interfaces:
java.io.Serializable

public class AbleSwitchRule
extends AbleRule
implements java.io.Serializable

This class holds the expressions and actions used in a 'switch' scripting rule. The integer expression can be an arbitrarily complex expression that must produce an integer and the then{} and else{} sections can contain one or more consequent (action) clauses.

Since:
ABLE 2.2.0
See Also:
Serialized Form

Field Summary
protected  AbleSwitchStatement mySwitchStatement
          mySwitchStatement is an ABLE statement that is evaluated when this rule is fired.
 
Fields inherited from class com.ibm.able.rules.AbleRule
myBooleanTruth, myBreakpoint, myComment, myEnabled, myFinalFlag, myFiredCount, myFiredFlag, myId, myLabel, myLocation, myPreConditions, myPriority, myPrompt, myProperties, myRdRefs, myRuleBlock, myRuleSet, myTemplateFlag, myTemplateName, myTemplateValues, myWrRefs, PriorityDefault, RuleIdInitial
 
Constructor Summary
AbleSwitchRule(java.lang.String theLabel, AbleRd thePriority)
          Creates a new switch rule with the specified label and priority.
AbleSwitchRule(java.lang.String theLabel, AbleRd thePriority, AbleSwitchStatement theSwitchStatement)
          Creates a new switch rule with the specified label, priority, and switch statement.
 
Method Summary
 java.lang.String arlString()
          Returns a formal ABLE Rule Language (ARL) string representation of this rule.
 java.lang.String armlString()
          Returns a formal ABLE Rule Markup Language (ARML) string representation of this rule.
 AbleSwitchStatement getSwitchStatement()
          Retrieves this rule's switch statement.
 java.lang.String getTemplateString(java.util.Vector theTemplateVars)
          Retrieve a text format string for use by rule templates.
 boolean setSwitchStatement(AbleSwitchStatement theSwitchStatement)
          Sets this rule's switch statement to be the specified switch statement, but only if a switch statement does not already exist for this rule.
 java.lang.String toString()
          Retrieves a string describing (the contents of) the object.
 java.lang.String traceString(int theTraceStringFlavor)
          Retrieves a string describing (the contents of) the object.
 java.lang.String xmlString()
          Returns a formal XML string representation of this rule.
 
Methods inherited from class com.ibm.able.rules.AbleRule
addHeaderRdReferences, addRdReference, addRdReferences, addWrReference, addWrReferences, arlActionBlockString, arlPreConditionsString, armlPreConditionsString, armlPriorityString, armlPropertiesString, checkTimePeriodPreConditions, clearBreakpoint, getArlComment, getBooleanTruth, getBreakpoint, getComment, getId, getIdLabelString, getLabel, getLocation, getMetaData, getPreConditions, getPriority, getPrompt, getPromptString, getProperties, getProperty, getRdReferences, getTemplateActionBlockString, getTemplateHeaderString, getTemplateName, getTemplateValues, getTemplateVars, getWrReferences, isDefaultPriority, isEnabled, isFinal, isFired, isGeneratedFromTemplate, isTemplate, logTrace, removeProperty, reset, setBooleanTruth, setBreakpoint, setComment, setEnabled, setFinal, setFired, setId, setLocation, setMetaData, setPreConditions, setPriority, setPrompt, setProperties, setProperty, setTemplate, setTemplateName, setTemplateValues, xmlPreConditionsString, xmlPriorityString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mySwitchStatement

protected AbleSwitchStatement mySwitchStatement
mySwitchStatement is an ABLE statement that is evaluated when this rule is fired.

Constructor Detail

AbleSwitchRule

public AbleSwitchRule(java.lang.String theLabel,
                      AbleRd thePriority,
                      AbleSwitchStatement theSwitchStatement)
Creates a new switch rule with the specified label, priority, and switch statement.

Parameters:
theLabel - The unique label, or name, of this rule.
thePriority - The priority of this rule.
theSwitchStatement - An AbleSwitchStatement that defines the content of this rule.

AbleSwitchRule

public AbleSwitchRule(java.lang.String theLabel,
                      AbleRd thePriority)
Creates a new switch rule with the specified label and priority. Use setSwitchStatement(AbleSwitchStatement) to set the switch statement into the rule before the rule is processed.

Parameters:
theLabel - The unique label, or name, of this rule.
thePriority - The priority of this rule.
Method Detail

setSwitchStatement

public boolean setSwitchStatement(AbleSwitchStatement theSwitchStatement)
Sets this rule's switch statement to be the specified switch statement, but only if a switch statement does not already exist for this rule. If a switch statement already exists, this call is ignored.

Parameters:
theSwitchStatement - An AbleSwitchStatement that defines the content of this rule.
Returns:
true if no switch statement is currently set and the switch statement was saved successfully; false if a switch statement is already set, in which case the specified switch statement is ignored.

getSwitchStatement

public AbleSwitchStatement getSwitchStatement()
Retrieves this rule's switch statement.

Returns:
this rule's switch statement. If no switch statement exists in this rule, null is returned.

arlString

public java.lang.String arlString()
Returns a formal ABLE Rule Language (ARL) string representation of this rule.

Specified by:
arlString in class AbleRule
Returns:
An ARL representation of this rule.

armlString

public java.lang.String armlString()
Returns a formal ABLE Rule Markup Language (ARML) string representation of this rule.

Specified by:
armlString in class AbleRule
Returns:
An ARML representation of this rule.

xmlString

public java.lang.String xmlString()
Returns a formal XML string representation of this rule.

Specified by:
xmlString in class AbleRule
Returns:
An XML representation of this rule.

getTemplateString

public java.lang.String getTemplateString(java.util.Vector theTemplateVars)
                                   throws AbleDataException
Retrieve a text format string for use by rule templates. The string contains "{n}" strings, where the index 'n' corresponds to the template variables defined in the rule template. This string is based on the standard arlString() representation of the rule. After replacement of the template variable values, the resulting string must be a valid ARL format string that can be parsed.

Specified by:
getTemplateString in class AbleRule
Parameters:
theTemplateVars - An ordered list of template variables referenced by this rule.
Returns:
A Text format string used to create a new rule instance.
Throws:
AbleDataException
See Also:
AbleRuleTemplate

toString

public java.lang.String toString()
Retrieves a string describing (the contents of) the object.

Overrides:
toString in class AbleRule
Returns:
A String containing the current contents of the object.

traceString

public java.lang.String traceString(int theTraceStringFlavor)
Retrieves a string describing (the contents of) the object.

Specified by:
traceString in class AbleRule
Parameters:
theTraceStringFlavor - An Able.TraceStringFlavor value.
Returns:
A String containing the current contents of the object.

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005