ca.uhn.hl7v2.validation.impl
Class RuleBinding

java.lang.Object
  extended by ca.uhn.hl7v2.validation.impl.RuleBinding
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MessageRuleBinding

public class RuleBinding
extends java.lang.Object
implements java.io.Serializable

An association between a type of item to be validated (eg a datatype or message) and a validation Rule.

Version:
$Revision: 1.1.6.1 $ updated on $Date: 2010/05/09 18:50:33 $ by $Author: jamesagnew $
Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
RuleBinding(java.lang.String theVersion, java.lang.String theScope, Rule theRule)
          Active by default.
 
Method Summary
protected  boolean applies(java.lang.String theBindingData, java.lang.String theItemData)
          An abstraction of appliesToVersion() and appliesToScope().
 boolean appliesToScope(java.lang.String theType)
           
 boolean appliesToVersion(java.lang.String theVersion)
           
 boolean getActive()
           
 Rule getRule()
           
 java.lang.String getScope()
           
 java.lang.String getVersion()
           
 void setActive(boolean isActive)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleBinding

public RuleBinding(java.lang.String theVersion,
                   java.lang.String theScope,
                   Rule theRule)
Active by default.

Parameters:
theVersion - see getVersion()
theScope - see getScope()
theRule - see getRule()
Method Detail

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 java.lang.String getVersion()
Returns:
the version to which the binding applies (* means all versions)

getScope

public java.lang.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 Rule getRule()
Returns:
a Rule that applies to the associated version and scope

appliesToVersion

public boolean appliesToVersion(java.lang.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(java.lang.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 boolean applies(java.lang.String theBindingData,
                          java.lang.String theItemData)
An abstraction of appliesToVersion() and appliesToScope().

Parameters:
theBindingData -
theItemData -
Returns:


Copyright © 2001-2011 University Health Network. All Rights Reserved.