Class DFAValidator


  • public final class DFAValidator
    extends StructValidator
    Validator class that is based on a DFA constructed from DTD content specification.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) DFAState mState
      For root validator instance, the start state of DFA; for other instances, current state.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String fullyValid()
      Method called when the end element of the scope this validator validates is encountered.
      StructValidator newInstance()
      Method that should be called to get the actual usable validator instance, from the 'template' validator.
      java.lang.String tryToValidate​(PrefixedName elemName)
      Method called when a new (start) element is encountered within the scope of parent element this validator monitors.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mState

        DFAState mState
        For root validator instance, the start state of DFA; for other instances, current state.
    • Constructor Detail

      • DFAValidator

        public DFAValidator​(DFAState initialState)
    • Method Detail

      • tryToValidate

        public java.lang.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 java.lang.String fullyValid()
        Description copied from class: StructValidator
        Method called when the end element of the scope this validator validates is encountered. It should make sure that the content model is valid, and if not, to construct an error message.
        Specified by:
        fullyValid in class StructValidator
        Returns:
        Null if the content model for the element is valid; error message if not.