domparser.Rules
Class AbstractRuleset

java.lang.Object
  |
  +--domparser.Rules.AbstractRuleset
All Implemented Interfaces:
RulesetInterface
Direct Known Subclasses:
ComponentRuleset, ConformanceRuleset, DataValueRuleset, DerivativeRuleset, DescriptionRuleset, EncodingRuleset, EncodingsRuleset, EventFlowRuleset, FieldRuleset, GenericRuleset, ImpNoteRuleset, MessageRuleset, ParagraphRuleset, PostconditionRuleset, PreconditionRuleset, PredicateRuleset, ReferenceRuleset, SegmentGroupRuleset, SegmentRuleset, SpecificationRuleset, STRuleset, SubcomponentRuleset, UseCaseRuleset

public abstract class AbstractRuleset
extends java.lang.Object
implements RulesetInterface

Defines the structure and basic methods for a Ruleset Object.

Version:
1.0
Author:
David Kong, Queen's University, August 2002.

Constructor Summary
AbstractRuleset()
          Constructor
 
Method Summary
 void addRule(java.lang.String name, java.lang.Class c, java.lang.Boolean active)
          Adds a rule to the Ruleset.
 java.lang.Boolean[] getActiveArray()
          Retrieves the array of Boolean objects defining what rules in the Ruleset are active.
 java.lang.Class[] getAllActiveRules()
          Retrieves all the active rules in the Ruleset, as an array of Class objects.
 java.lang.Class[] getClasses()
          Retrieves the Class objects defined in the Ruleset as an array of Class objects.
 java.lang.Class getRule(java.lang.String name)
          Retrieves a RuleObject from the Ruleset, returned as a Class object.
 java.lang.String[] getRuleNames()
          Retrieves the names of all the rules in the Ruleset as a String array.
 void trimArrays()
          Trims the active, classes, names Arraylists
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRuleset

public AbstractRuleset()
Constructor
Method Detail

addRule

public void addRule(java.lang.String name,
                    java.lang.Class c,
                    java.lang.Boolean active)
             throws HL7Exception

Adds a rule to the Ruleset.

Specified by:
addRule in interface RulesetInterface
Parameters:
name - The name of the rule to add.
c - The class name of the rule to add.
active - The boolean flag for the rule. True means the rule is active.
Throws:
HL7Exception -  

getRule

public java.lang.Class getRule(java.lang.String name)
                        throws HL7Exception

Retrieves a RuleObject from the Ruleset, returned as a Class object.

Specified by:
getRule in interface RulesetInterface
Parameters:
name - The name of the rule to retrieve.
Throws:
HL7Exception -  

getRuleNames

public java.lang.String[] getRuleNames()
                                throws HL7Exception

Retrieves the names of all the rules in the Ruleset as a String array.

Specified by:
getRuleNames in interface RulesetInterface
Throws:
HL7Exception -  

getAllActiveRules

public java.lang.Class[] getAllActiveRules()
                                    throws HL7Exception

Retrieves all the active rules in the Ruleset, as an array of Class objects.

Specified by:
getAllActiveRules in interface RulesetInterface
Throws:
HL7Exception -  

trimArrays

public void trimArrays()

Trims the active, classes, names Arraylists

Specified by:
trimArrays in interface RulesetInterface

getClasses

public java.lang.Class[] getClasses()
                             throws HL7Exception

Retrieves the Class objects defined in the Ruleset as an array of Class objects.

Specified by:
getClasses in interface RulesetInterface
Throws:
HL7Exception -  

getActiveArray

public java.lang.Boolean[] getActiveArray()
                                   throws HL7Exception

Retrieves the array of Boolean objects defining what rules in the Ruleset are active.

Specified by:
getActiveArray in interface RulesetInterface