Class AbstractXMLValidator

    • Field Detail

      • document

        protected Document document
        Document to be validated.
      • documentBuilder

        protected DocumentBuilder documentBuilder
        XML document builder.
    • Constructor Detail

      • AbstractXMLValidator

        public AbstractXMLValidator()
        Constructor.
      • AbstractXMLValidator

        public AbstractXMLValidator​(boolean validateXML)
        Constructor.
        Parameters:
        validateXML - indicate if the XML input should be validated.
    • Method Detail

      • createXMLErrorHandler

        protected XMLErrorHandler createXMLErrorHandler()
        Returns:
        the error handler to use when parsing the xml content
      • setValidateXML

        public void setValidateXML​(boolean validateXML)
        Parameters:
        validateXML - indicate if the XML input should be validated.
      • setDocument

        public void setDocument​(InputStream document)
        Description copied from interface: Validator
        Set document to validate.
        Specified by:
        setDocument in interface Validator
        Parameters:
        document - document to validate
      • validate

        protected void validate​(Document document)
        Parameters:
        document - the XML document
      • clear

        public void clear()
        Clear the validator errors.
        Specified by:
        clear in interface Validator
      • getDocument

        public Document getDocument()
        Returns:
        the XML document
      • getErrorHandler

        protected XMLErrorHandler getErrorHandler()
        Returns:
        the XML error handler
      • addError

        protected void addError​(ValidationError.Type errorType,
                                int line,
                                int column,
                                String message)
        Add an error message to the list.
        Parameters:
        errorType - type of the error
        line - line where the error occurred
        column - where the error occurred
        message - the message to add