public class ValidationContextFactory extends Object
The ValidationContext
returned by getContext()
is
determined by the system property "ca.uhn.hl7v2.validation.context_class".
This factory defines two inner classes that can be used: DefaultValidation
and NoValidation. You can also create your own context, setting whatever
rules you want in its constructor, and reference it instead (it must have a
zero-arg constructor). If this property is not set, DefaultValidation is
used.
Also note that the contexts provided here use
ValidationContextImpl
, so rule bindings can be added or removed
programmatically from the starting set.
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_PROPERTY |
Constructor and Description |
---|
ValidationContextFactory() |
Modifier and Type | Method and Description |
---|---|
static ValidationRuleBuilder |
customBuilder(String ruleBuilderClassName) |
static ValidationContext |
customValidation(String contextClassName) |
static ValidationContext |
defaultValidation() |
static ValidationContext |
fromBuilder(String ruleBuilderClassName) |
static ValidationContext |
fromBuilder(ValidationRuleBuilder builder) |
static ValidationContext |
getContext()
Returns a singleton
ValidationContext , creating it if
necessary. |
static ValidationContext |
noValidation() |
public static final String CONTEXT_PROPERTY
public ValidationContextFactory()
public static ValidationContext getContext() throws HL7Exception
ValidationContext
, creating it if
necessary.ValidationContext
HL7Exception
public static ValidationContext noValidation()
public static ValidationContext defaultValidation()
public static ValidationRuleBuilder customBuilder(String ruleBuilderClassName) throws HL7Exception
ruleBuilderClassName
- class name of a ValidationRuleBuilder
subclassHL7Exception
- if builder cannot be builtpublic static ValidationContext fromBuilder(String ruleBuilderClassName) throws HL7Exception
HL7Exception
public static ValidationContext fromBuilder(ValidationRuleBuilder builder)
public static ValidationContext customValidation(String contextClassName) throws HL7Exception
contextClassName
- class name of a ValidationContext
subclassHL7Exception
- if context cannot be obtainedCopyright © 2001–2017 University Health Network. All rights reserved.