Package ca.uhn.hl7v2.validation.builder
Class PrimitiveRuleBuilder
java.lang.Object
ca.uhn.hl7v2.validation.builder.BuilderSupport
ca.uhn.hl7v2.validation.builder.RuleTypeBuilder<PrimitiveRuleBuilder,PrimitiveTypeRule>
ca.uhn.hl7v2.validation.builder.PrimitiveRuleBuilder
- All Implemented Interfaces:
Serializable
Rule builder for
PrimitiveTypeRules- Author:
- Christian Ohr
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ca.uhn.hl7v2.validation.builder.RuleTypeBuilder
RuleTypeBuilder.MessageExpressionBuilder -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrimitiveRuleBuilder(List<RuleBinding<? extends Rule<?>>> rules, Set<Version> versions, Set<String> types) -
Method Summary
Modifier and TypeMethodDescriptionallTrim()Builds aPrimitiveTypeRulethat always evaluates totrueand trims leading and trailing whitespaces.Builds aPrimitiveTypeRulethat evaluates the specifiedPredicateagainst the primitive value with leading and trailing whitespaces trimmed.protected Collection<RuleBinding<PrimitiveTypeRule>>getRuleBindings(PrimitiveTypeRule rule, String version) Builder implementation must overwrite this method to return allRuleBindings for rules that have been built.Builds aPrimitiveTypeRulethat evaluates the specifiedPredicateagainst the primitive value.leftTrim()Builds aPrimitiveTypeRulethat always evaluates totrueand trims leading whitespaces.Builds aPrimitiveTypeRulethat evaluates the specifiedPredicateagainst the primitive value with leading whitespaces trimmed.Builds aPrimitiveTypeRulethat always evaluates totrueand trims trailing whitespaces.Builds aPrimitiveTypeRulethat evaluates the specifiedPredicateagainst the primitive value with trailing whitespaces trimmed.Methods inherited from class ca.uhn.hl7v2.validation.builder.RuleTypeBuilder
activate, active, addRuleBindings, description, encoding, getRules, instance, message, message, prepareRule, primitive, refersToSection, severity, testMethods 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
-
PrimitiveRuleBuilder
protected PrimitiveRuleBuilder(List<RuleBinding<? extends Rule<?>>> rules, Set<Version> versions, Set<String> types)
-
-
Method Details
-
is
Builds aPrimitiveTypeRulethat evaluates the specifiedPredicateagainst the primitive value.- Parameters:
predicate- predicate to evaluate the primitive value against- Returns:
- this instance to build more rules
-
leftTrim
Builds aPrimitiveTypeRulethat evaluates the specifiedPredicateagainst the primitive value with leading whitespaces trimmed.- Parameters:
predicate- predicate to evaluate the primitive value against- Returns:
- this instance to build more rules
-
leftTrim
Builds aPrimitiveTypeRulethat always evaluates totrueand trims leading whitespaces.- Returns:
- this instance to build more rules
-
rightTrim
Builds aPrimitiveTypeRulethat always evaluates totrueand trims trailing whitespaces.- Returns:
- this instance to build more rules
-
rightTrim
Builds aPrimitiveTypeRulethat evaluates the specifiedPredicateagainst the primitive value with trailing whitespaces trimmed.- Parameters:
predicate- predicate to evaluate the primitive value against- Returns:
- this instance to build more rules
-
allTrim
Builds aPrimitiveTypeRulethat always evaluates totrueand trims leading and trailing whitespaces.- Returns:
- this instance to build more rules
-
allTrim
Builds aPrimitiveTypeRulethat evaluates the specifiedPredicateagainst the primitive value with leading and trailing whitespaces trimmed.- Parameters:
predicate- predicate to evaluate the primitive value against- Returns:
- this instance to build more rules
-
getRuleBindings
protected Collection<RuleBinding<PrimitiveTypeRule>> getRuleBindings(PrimitiveTypeRule rule, String version) Description copied from class:RuleTypeBuilderBuilder implementation must overwrite this method to return allRuleBindings for rules that have been built.- Overrides:
getRuleBindingsin classRuleTypeBuilder<PrimitiveRuleBuilder,PrimitiveTypeRule> - Parameters:
rule- the rule for which bindings shall be retrievedversion- the HL7 version for which bindings shall be retrieved- Returns:
- a collection of
RuleBindings
-