Class EmptyValidator


  • public class EmptyValidator
    extends StructValidator
    Simple content model validator that accepts no elements, ever; this is true for pure #PCDATA content model as well as EMPTY content model. Can be used as a singleton, since all info needed for diagnostics is passed via methods.
    • Method Detail

      • getPcdataInstance

        public static EmptyValidator getPcdataInstance()
      • tryToValidate

        public String tryToValidate​(PrefixedName elemName)
        Description copied from class: StructValidator
        Method called when a new (start) element is encountered within the scope of parent element this validator monitors.
        Specified by:
        tryToValidate in class StructValidator
        Returns:
        Null if element is valid in its current position; error message if not.
      • fullyValid

        public String fullyValid()
        If we ever get as far as element closing, things are all good; can just return null.
        Specified by:
        fullyValid in class StructValidator
        Returns:
        Null if the content model for the element is valid; error message if not.