Package ca.uhn.hl7v2.validation.builder
Class RuleTypeBuilder<S extends RuleTypeBuilder<S,T>,T extends Rule<?>>
java.lang.Object
ca.uhn.hl7v2.validation.builder.BuilderSupport
ca.uhn.hl7v2.validation.builder.RuleTypeBuilder<S,T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EncodingRuleBuilder,MessageRuleBuilder,PrimitiveRuleBuilder,ValidationRuleBuilder
public class RuleTypeBuilder<S extends RuleTypeBuilder<S,T>,T extends Rule<?>>
extends BuilderSupport
Defines the type of rule to be built.
The recursive type parameter allows the builder methods common to all subclasses (e.g.
refersToSection(java.lang.String), active, test(T)) to return their specific builder type.- Author:
- Christian Ohr
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassHelper builder when the events are not given explicitly but in form of an expression. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedRuleTypeBuilder(List<RuleBinding<? extends Rule<?>>> rules, Version... versions) protectedRuleTypeBuilder(List<RuleBinding<? extends Rule<?>>> rules, Set<Version> versions) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<RuleBinding<T>>activate(Collection<RuleBinding<T>> bindings) active(boolean active) Marks the rule as being active (default) or inactiveprotected voidaddRuleBindings(T rule) AddRuleBindings for the rule that have been builtdescription(String description) Adds a description to the ruleBuildsMessageRules for the specified encodingprotected Collection<RuleBinding<T>>getRuleBindings(T rule, String version) Builder implementation must overwrite this method to return allRuleBindings for rules that have been built.protected List<RuleBinding<? extends Rule<?>>>getRules()protected Sinstance()message()BuildsMessageRules for event types and triggers to be specified using the returned MessageExpressionBuilder.BuildsMessageRules for the specified event types and triggersprotected TprepareRule(T rule) BuildsPrimitiveTypeRules for the specified typesrefersToSection(String sectionReference) Adds a HL7 section reference to a ruleSets the severity of the ruleAdds the specified rule to the set of rules.Methods inherited from class ca.uhn.hl7v2.validation.builder.BuilderSupport
allOf, allOf, always, alwaysFails, anyOf, anyOf, date, dateTime, dateTime25, empty, emptyOr, in, in, isEqual, isEqualIgnoreCase, matches, matches, matches, maxLength, nonNegativeInteger, not, number, oid, startsWith, time, usPhoneNumber, uuid, withdrawn
-
Constructor Details
-
RuleTypeBuilder
protected RuleTypeBuilder() -
RuleTypeBuilder
-
RuleTypeBuilder
-
-
Method Details
-
instance
-
getRules
-
prepareRule
-
description
Adds a description to the rule- Parameters:
description- description- Returns:
- this instance to build more rules
-
refersToSection
Adds a HL7 section reference to a rule- Parameters:
sectionReference- the section in the HL7 specification- Returns:
- this instance to build more rules
-
severity
Sets the severity of the rule- Parameters:
severity- the the severity of the rule- Returns:
- this instance to build more rules
-
active
Marks the rule as being active (default) or inactive- Parameters:
active- true if this rule shall be active- Returns:
- this instance to build more rules
-
test
Adds the specified rule to the set of rules.- Parameters:
rule- the rule to be tested- Returns:
- this instance to build more rules
-
primitive
BuildsPrimitiveTypeRules for the specified types- Parameters:
type- an array of types- Returns:
- this instance to continue building rules
-
message
BuildsMessageRules for the specified event types and triggers- Parameters:
eventType- Event type, e.g. "ADT", or "*" for all typestriggerEvents- , e.g. "A01" or "A01,A04", or "*" for all trigger events- Returns:
- this instance to continue building rules
-
message
BuildsMessageRules for event types and triggers to be specified using the returned MessageExpressionBuilder.- Returns:
- MessageExpressionBuilder instance to continue building rules
-
encoding
BuildsMessageRules for the specified encoding- Parameters:
encoding- "XML" or "VB"- Returns:
- this instance to continue building rules
-
addRuleBindings
AddRuleBindings for the rule that have been built- Parameters:
rule- the rule for which bindings shall be added
-
getRuleBindings
Builder implementation must overwrite this method to return allRuleBindings for rules that have been built.- Parameters:
rule- the rule for which bindings shall be retrievedversion- the HL7 version for which bindings shall be retrieved- Returns:
- a collection of
RuleBindings
-
activate
-