Package ca.uhn.hl7v2.validation.impl
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
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 Summary
ConstructorsConstructorDescriptionRuleBinding(String theVersion, String theScope, T theRule) Active by default. -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanAn abstraction of appliesToVersion() and appliesToScope().booleanappliesToScope(String theType) booleanappliesToVersion(String theVersion) booleangetRule()getScope()voidsetActive(boolean isActive) toString()
-
Constructor Details
-
RuleBinding
Active by default.- Parameters:
theVersion- seegetVersion()theScope- seegetScope()theRule- seegetRule()
-
-
Method Details
-
getActive
- Returns:
- true if the binding is currently active
-
setActive
- Parameters:
isActive- true if the binding is currently active
-
getVersion
- Returns:
- the version to which the binding applies (* means all versions)
-
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). ForPrimitiveTypeRules this is the datatype name (* means any). ForEncodingRules this is the encoding name (again, * means any).
-
getRule
- Returns:
- a
Rulethat applies to the associated version and scope
-
appliesToVersion
- Parameters:
theVersion- an HL7 version- Returns:
- true if this binding applies to the given version (ie getVersion() matches or is *)
-
appliesToScope
- 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
An abstraction of appliesToVersion() and appliesToScope(). Compares two values and returns true if they are equal or if the binding data is "*" -
toString
-