wt.rule
Class CompositeRule

java.lang.Object
  extended bywt.rule.CompositeRule
All Implemented Interfaces:
AccessControlled, Externalizable, NetFactor, Rule, Serializable

public class CompositeRule
extends Object
implements Rule, Externalizable

A rule that represents a composite of other rules. This rule is not peristent.

Use the newCompositeRule static factory method(s), not the CompositeRule constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  String contents
           
private  boolean defaultRule
           
private  String description
           
private  String encoding
           
static long EXTERNALIZATION_VERSION_UID
           
private  ObjectIdentifier[] mergedRules
           
private  String name
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
private  RuleType ruleType
           
(package private) static long serialVersionUID
           
 
Fields inherited from interface wt.rule.Rule
DEFAULT_RULE, DESCRIPTION, NAME, RULE_TYPE
 
Constructor Summary
CompositeRule()
           
 
Method Summary
private  void descriptionValidate(String a_Description)
           
 ClassInfo getClassInfo()
          Returns the ClassInfo object for this class.
 String getConceptualClassname()
          Deprecated.  
 String getContents()
          Gets the value of the attribute: contents; the String content of the rule's specification

Supported API: false
 String getDescription()
          Gets the value of the attribute: description; A description of the rule's content and purpose.
 String getEncoding()
          Gets the value of the attribute: encoding; the character encoding of the rule's specification

Supported API: false
 InputSource getInputSource()
          Get an InputSource on the contents of this rule's XML specification.
 ObjectIdentifier[] getMergedRules()
          Gets the value of the attribute: mergedRules; A list of the ObjectIdentifiers for the rules that were merged to produce this composite rule.
 String getName()
          Gets the value of the attribute: name; The name of the rule.
 RuleType getRuleType()
          Gets the value of the attribute: ruleType; The type of business logic described by this rule.
protected  void initialize(RuleType ruleType)
          Supports initialization, following construction of an instance.
 boolean isDefaultRule()
          Gets the value of the attribute: defaultRule; Specifies whether or not this is a default rule.
 boolean isEnabled()
          Specifies whether or not this rule is enabled.
private  void nameValidate(String a_Name)
           
static CompositeRule newCompositeRule(RuleType ruleType)
          Create a new composite rule with the specified RuleType.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(CompositeRule thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setContents(String a_Contents)
          Sets the value of the attribute: contents; the String content of the rule's specification

Supported API: false
 void setDefaultRule(boolean a_DefaultRule)
          Sets the value of the attribute: defaultRule; Specifies whether or not this is a default rule.
 void setDescription(String a_Description)
          Sets the value of the attribute: description; A description of the rule's content and purpose.
 void setEncoding(String a_Encoding)
          Sets the value of the attribute: encoding; the character encoding of the rule's specification

Supported API: false
 void setMergedRules(ObjectIdentifier[] a_MergedRules)
          Sets the value of the attribute: mergedRules; A list of the ObjectIdentifiers for the rules that were merged to produce this composite rule.
 void setMergedRules(Rule[] mergedRules)
          A convenience method for setting the value of the mergedRules attribute.
 void setName(String a_Name)
          Sets the value of the attribute: name; The name of the rule.
 void setRuleType(RuleType a_RuleType)
          Sets the value of the attribute: ruleType; The type of business logic described by this rule.
 String toString()
          Returns the conceptual (modeled) name for the class.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

name

private String name

ruleType

private RuleType ruleType

defaultRule

private boolean defaultRule

description

private String description

contents

private String contents

encoding

private String encoding

mergedRules

private ObjectIdentifier[] mergedRules

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values
Constructor Detail

CompositeRule

public CompositeRule()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(CompositeRule thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

toString

public String toString()
Returns the conceptual (modeled) name for the class.

Supported API: false

Returns:
String

getClassInfo

public ClassInfo getClassInfo()
                       throws WTIntrospectionException
Returns the ClassInfo object for this class.

Supported API: false

Specified by:
getClassInfo in interface NetFactor
Returns:
ClassInfo
Throws:
WTIntrospectionException

getName

public String getName()
Gets the value of the attribute: name; The name of the rule.

Supported API: false

Specified by:
getName in interface Rule
Returns:
String

setName

public void setName(String a_Name)
Sets the value of the attribute: name; The name of the rule.

Supported API: false

Specified by:
setName in interface Rule
Parameters:
a_Name -

getRuleType

public RuleType getRuleType()
Gets the value of the attribute: ruleType; The type of business logic described by this rule.

Supported API: false

Specified by:
getRuleType in interface Rule
Returns:
RuleType

setRuleType

public void setRuleType(RuleType a_RuleType)
Sets the value of the attribute: ruleType; The type of business logic described by this rule.

Supported API: false

Specified by:
setRuleType in interface Rule
Parameters:
a_RuleType -

isDefaultRule

public boolean isDefaultRule()
Gets the value of the attribute: defaultRule; Specifies whether or not this is a default rule.

Supported API: false

Specified by:
isDefaultRule in interface Rule
Returns:
boolean

setDefaultRule

public void setDefaultRule(boolean a_DefaultRule)
Sets the value of the attribute: defaultRule; Specifies whether or not this is a default rule.

Supported API: false

Specified by:
setDefaultRule in interface Rule
Parameters:
a_DefaultRule -

getDescription

public String getDescription()
Gets the value of the attribute: description; A description of the rule's content and purpose.

Supported API: false

Specified by:
getDescription in interface Rule
Returns:
String

setDescription

public void setDescription(String a_Description)
Sets the value of the attribute: description; A description of the rule's content and purpose.

Supported API: false

Specified by:
setDescription in interface Rule
Parameters:
a_Description -

getContents

public String getContents()
Gets the value of the attribute: contents; the String content of the rule's specification

Supported API: false

Specified by:
getContents in interface Rule
Returns:
String

setContents

public void setContents(String a_Contents)
Sets the value of the attribute: contents; the String content of the rule's specification

Supported API: false

Specified by:
setContents in interface Rule
Parameters:
a_Contents -

getEncoding

public String getEncoding()
Gets the value of the attribute: encoding; the character encoding of the rule's specification

Supported API: false

Specified by:
getEncoding in interface Rule
Returns:
String

setEncoding

public void setEncoding(String a_Encoding)
Sets the value of the attribute: encoding; the character encoding of the rule's specification

Supported API: false

Specified by:
setEncoding in interface Rule
Parameters:
a_Encoding -

getMergedRules

public ObjectIdentifier[] getMergedRules()
Gets the value of the attribute: mergedRules; A list of the ObjectIdentifiers for the rules that were merged to produce this composite rule.

The order of the identifiers matches the order in which the rules were merged. So, the structure of this array mimics the structure of the array passed into RuleService.mergeRules(wt.rule.Rule[], wt.rule.RuleType).

Supported API: false

Returns:
ObjectIdentifier[]

setMergedRules

public void setMergedRules(ObjectIdentifier[] a_MergedRules)
                    throws WTPropertyVetoException
Sets the value of the attribute: mergedRules; A list of the ObjectIdentifiers for the rules that were merged to produce this composite rule.

The order of the identifiers matches the order in which the rules were merged. So, the structure of this array mimics the structure of the array passed into RuleService.mergeRules(wt.rule.Rule[], wt.rule.RuleType).

Supported API: false

Parameters:
a_MergedRules -
Throws:
WTPropertyVetoException

newCompositeRule

public static CompositeRule newCompositeRule(RuleType ruleType)
                                      throws WTException
Create a new composite rule with the specified RuleType.

Supported API: false

Parameters:
ruleType -
Returns:
CompositeRule
Throws:
WTException

initialize

protected void initialize(RuleType ruleType)
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: false

Parameters:
ruleType -
Throws:
WTException

setMergedRules

public void setMergedRules(Rule[] mergedRules)
                    throws WTPropertyVetoException
A convenience method for setting the value of the mergedRules attribute.

Supported API: false

Parameters:
mergedRules - list of the rules that were merged to produce this composite rule.
Throws:
WTPropertyVetoException

nameValidate

private void nameValidate(String a_Name)
                   throws WTPropertyVetoException
Parameters:
a_Name -
Throws:
WTPropertyVetoException

descriptionValidate

private void descriptionValidate(String a_Description)
                          throws WTPropertyVetoException
Parameters:
a_Description -
Throws:
WTPropertyVetoException

getInputSource

public InputSource getInputSource()
                           throws UnsupportedEncodingException
Get an InputSource on the contents of this rule's XML specification.

This method returns null if the rule specification has no content.

Supported API: false

Specified by:
getInputSource in interface Rule
Returns:
InputSource
Throws:
UnsupportedEncodingException

isEnabled

public boolean isEnabled()
Specifies whether or not this rule is enabled. An enabled rule is available for use. A disabled rule should not be used.

Supported API: false

Specified by:
isEnabled in interface Rule
Returns:
boolean