Class RuleBinding<T extends Rule<?>>

java.lang.Object
ca.uhn.hl7v2.validation.impl.RuleBinding<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EncodingRuleBinding, MessageRuleBinding, PrimitiveTypeRuleBinding

public class RuleBinding<T extends Rule<?>> extends Object implements Serializable
An association between a type of item to be validated (eg a datatype or message) and a validation Rule.
Author:
Bryan Tripp, James Agnew, Christian Ohr
See Also:
  • Constructor Details

  • Method Details

    • getActive

      public boolean getActive()
      Returns:
      true if the binding is currently active
    • setActive

      public void setActive(boolean isActive)
      Parameters:
      isActive - true if the binding is currently active
    • getVersion

      public String getVersion()
      Returns:
      the version to which the binding applies (* means all versions)
    • getScope

      public String getScope()
      Returns:
      the scope of item types to which the rule applies. For MessageRules this is the message type and trigger event, separated by a ^ (either value may be *, meaning any). For PrimitiveTypeRules this is the datatype name (* means any). For EncodingRules this is the encoding name (again, * means any).
    • getRule

      public T getRule()
      Returns:
      a Rule that applies to the associated version and scope
    • appliesToVersion

      public boolean appliesToVersion(String theVersion)
      Parameters:
      theVersion - an HL7 version
      Returns:
      true if this binding applies to the given version (ie getVersion() matches or is *)
    • appliesToScope

      public boolean appliesToScope(String theType)
      Parameters:
      theType - an item description to be checked against getScope()
      Returns:
      true if the given type is within scope, ie if it matches getScope() or getScope() is *
    • applies

      protected static boolean applies(String theBindingData, String theItemData)
      An abstraction of appliesToVersion() and appliesToScope(). Compares two values and returns true if they are equal or if the binding data is "*"
    • toString

      public String toString()
      Overrides:
      toString in class Object