ca.uhn.hl7v2.validation.impl
Class RuleBinding<T extends Rule>

java.lang.Object
  extended by 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.

Version:
$Revision: 1.2 $ updated on $Date: 2010-04-25 16:22:52 $ by $Author: jamesagnew $
Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
RuleBinding(String theVersion, String theScope, T theRule)
          Active by default.
 
Method Summary
protected  boolean applies(String theBindingData, String theItemData)
          An abstraction of appliesToVersion() and appliesToScope().
 boolean appliesToScope(String theType)
           
 boolean appliesToVersion(String theVersion)
           
 boolean getActive()
           
 T getRule()
           
 String getScope()
           
 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(String theVersion,
                   String theScope,
                   T 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 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 boolean applies(String theBindingData,
                          String theItemData)
An abstraction of appliesToVersion() and appliesToScope().

Parameters:
theBindingData -
theItemData -
Returns:


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