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 Details

  • Method Details

    • test

      public boolean test(String value)
      Description copied from interface: PrimitiveTypeRule
      Tests the given string against the criteria defined by this rule -- returns true if it passes the test, false otherwise.
      Specified by:
      test in interface PrimitiveTypeRule
    • correct

      public String correct(String value)
      Description copied from interface: PrimitiveTypeRule
      Optionally 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:
      correct in interface PrimitiveTypeRule
      Parameters:
      value - an original value to be corrected
      Returns:
      a corrected version of the given value