All Implemented Interfaces:
Cloneable

public class Rule extends RulebaseElement
Rule objects are the primary components of a rulebase. A Rule object consists primarilly of a data source and a list of tests.
  • Field Details

    • CNAME

      public static String CNAME
  • Constructor Details

  • Method Details

    • isConverted

      public boolean isConverted()
    • toString

      public String toString()
      Returns string representation of this rule.
      Overrides:
      toString in class Object
    • setOverRuling

      public void setOverRuling(int precedence)
      Sets the rule's precedence level used in overruling.
    • getOverRuling

      public int getOverRuling()
      Returns the rule's precedence level used in overruling.
    • getDataSource

      public DataSource getDataSource()
      Returns the rule's data source.
    • setDataSource

      public void setDataSource(DataSource ds)
      Sets the rule's data source.
      Parameters:
      ds - the data source, may not be null
      Throws:
      IllegalArgumentException - if ds is null
    • setTests

      public void setTests(Test[] tests) throws IllegalArgumentException
      Sets the array of Test objects used by this rule.
      Parameters:
      tests - the array of tests, may not be null, all names must be unique
      Throws:
      IllegalArgumentException - if tests is null
      IllegalArgumentException - if the test names are not unique
    • getTests

      public Test[] getTests()
      Returns the array of Test objects used by this rule.
    • equals

      public boolean equals(Object obj)
      Tests two Rule objects for equality
      Overrides:
      equals in class RulebaseElement
      Returns:
      true if the objects are the same; false otherwise
    • clone

      public Object clone()
      Returns a copy of this object
      Specified by:
      clone in class RulebaseElement
    • getDefaultName

      protected String getDefaultName()
      Returns the default name for this ClearAction element. This is a generated name so that if the name of this ClearAction is not given, this method will provide one.
    • clearTests

      protected void clearTests()
      Removes all the test in this rule.
    • toXML

      protected void toXML(COM.TIBCO.hawk.util.xml.XmlWriter out) throws IOException, RulebaseException
      Write XML representation of the rule to the XML writer.
      Overrides:
      toXML in class RulebaseElement
      Parameters:
      out - the XML writer where the output will be written.
      Throws:
      IOException
      RulebaseException
    • fromXML

      protected void fromXML(COM.TIBCO.hawk.util.xml.XmlElementNode node) throws RulebaseException
      Read XML representation of the rule from the XML node.
      Overrides:
      fromXML in class RulebaseElement
      Parameters:
      node - the XML node containing the rule.
      Throws:
      RulebaseException