Package ca.uhn.hl7v2.validation.impl
Class AbstractPrimitiveTypeRule
java.lang.Object
ca.uhn.hl7v2.validation.impl.RuleSupport<String>
ca.uhn.hl7v2.validation.impl.AbstractPrimitiveTypeRule
- All Implemented Interfaces:
PrimitiveTypeRule,Rule<String>,Serializable
- Direct Known Subclasses:
PredicatePrimitiveTypeRule,RegexPrimitiveRule,SizeRule,TrimLeadingWhitespace,TrimTrailingWhitespace
public abstract class AbstractPrimitiveTypeRule
extends RuleSupport<String>
implements PrimitiveTypeRule
Abstract base class for primitive rules
- Author:
- Christian Ohr
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptionally performs an automatic correction on given data to make it conform (eg trims leading whitespace).booleanTests the given string against the criteria defined by this rule -- returns true if it passes the test, false otherwise.Methods inherited from class ca.uhn.hl7v2.validation.impl.RuleSupport
failed, failed, failed, failed, failedWithValue, getDescription, getErrorCode, getSectionReference, getSeverity, passed, result, result, setDescription, setErrorCode, setSectionReference, setSeverityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.hl7v2.validation.Rule
apply, getDescription, getSectionReference
-
Constructor Details
-
AbstractPrimitiveTypeRule
public AbstractPrimitiveTypeRule()
-
-
Method Details
-
test
Description copied from interface:PrimitiveTypeRuleTests the given string against the criteria defined by this rule -- returns true if it passes the test, false otherwise.- Specified by:
testin interfacePrimitiveTypeRule
-
correct
Description copied from interface:PrimitiveTypeRuleOptionally performs an automatic correction on given data to make it conform (eg trims leading whitespace). This is to be called prior to test(). If no corrections are performed, the original value is returned.- Specified by:
correctin interfacePrimitiveTypeRule- Parameters:
value- an original value to be corrected- Returns:
- a corrected version of the given value
-