Package ca.uhn.hl7v2.validation.impl
Class ValidationContextImpl
java.lang.Object
ca.uhn.hl7v2.validation.impl.ValidationContextImpl
- All Implemented Interfaces:
ValidationContext,Serializable
- Direct Known Subclasses:
DefaultValidation,DefaultValidationWithoutTN,NoValidation
A default implementation of
ValidationContext.- Author:
- Bryan Tripp, Christian Ohr
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,Collection<EncodingRule>> protected Map<String,Collection<MessageRule>> protected Map<String,Collection<PrimitiveTypeRule>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEncodingRules(String theVersion, String theEncoding) getMessageRules(String theVersion, String theMessageType, String theTriggerEvent) getPrimitiveRules(String theVersion, String theTypeName, Primitive theType) protected voidInitializes caches for the three rule types.protected static <T extends Rule<?>>
Map<String,Collection<T>> newRuleCache(int size)
-
Field Details
-
primitiveRuleCache
-
messageRuleCache
-
encodingRuleCache
-
-
Constructor Details
-
ValidationContextImpl
public ValidationContextImpl()
-
-
Method Details
-
initCaches
Initializes caches for the three rule types. Used to accelerate the identification of the rules that apply to a message or primitive. -
getPrimitiveRules
public Collection<PrimitiveTypeRule> getPrimitiveRules(String theVersion, String theTypeName, Primitive theType) - Specified by:
getPrimitiveRulesin interfaceValidationContext- Parameters:
theType- ignoredtheVersion- an HL7 version (eg "2.1")theTypeName- a primitive datatype name (eg "ST")- Returns:
- active rules for checking the given type in the given version
- See Also:
-
getPrimitiveRuleBindings
- Returns:
- a List of
RuleBindings forPrimitiveTypeRules.
-
getMessageRules
public Collection<MessageRule> getMessageRules(String theVersion, String theMessageType, String theTriggerEvent) - Specified by:
getMessageRulesin interfaceValidationContext- Parameters:
theVersion- an HL7 version (eg "2.1")theMessageType- a value valid for MSH-9-1theTriggerEvent- a value valid fro MSH-9-2- Returns:
- the active rules that apply to message of the given version, message type, and trigger event
- See Also:
-
getMessageRuleBindings
- Returns:
- a List of
RuleBindings forMessageRules.
-
getEncodingRules
- Specified by:
getEncodingRulesin interfaceValidationContext- Parameters:
theVersion- an HL7 version (eg "2.1")theEncoding- an encoding name (eg "VB", "XML)- Returns:
- the active encoding rules that apply to the given version and encoding
- See Also:
-
getEncodingRuleBindings
- Returns:
- a List of
RuleBindings forEncodingRules.
-
newRuleCache
-