Class DocumentBuilderImpl


  • class DocumentBuilderImpl
    extends javax.xml.parsers.DocumentBuilder
    DocumentBuilder implementation that supports validation.

    This class uses another DocumentBuilder implementation and adds the validation capability to it.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.xml.parsers.DocumentBuilder core
      Wrapped DocumentBuilder that does everything else.
      private org.iso_relax.verifier.Verifier verifier
      The validation will be performed using this verifier.
    • Constructor Summary

      Constructors 
      Constructor Description
      DocumentBuilderImpl​(javax.xml.parsers.DocumentBuilder _core, org.iso_relax.verifier.Schema _schema)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.w3c.dom.DOMImplementation getDOMImplementation()  
      boolean isNamespaceAware()  
      boolean isValidating()  
      org.w3c.dom.Document newDocument()  
      org.w3c.dom.Document parse​(java.io.File f)  
      org.w3c.dom.Document parse​(java.io.InputStream is)  
      org.w3c.dom.Document parse​(java.io.InputStream is, java.lang.String systemId)  
      org.w3c.dom.Document parse​(java.lang.String url)  
      org.w3c.dom.Document parse​(org.xml.sax.InputSource is)  
      void setEntityResolver​(org.xml.sax.EntityResolver resolver)  
      void setErrorHandler​(org.xml.sax.ErrorHandler handler)  
      private org.w3c.dom.Document verify​(org.w3c.dom.Document dom)
      Validates a given DOM and returns it if it is valid.
      • Methods inherited from class javax.xml.parsers.DocumentBuilder

        getSchema, isXIncludeAware, reset
      • Methods inherited from class java.lang.Object

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

      • core

        private final javax.xml.parsers.DocumentBuilder core
        Wrapped DocumentBuilder that does everything else.
      • verifier

        private final org.iso_relax.verifier.Verifier verifier
        The validation will be performed using this verifier.
    • Constructor Detail

      • DocumentBuilderImpl

        DocumentBuilderImpl​(javax.xml.parsers.DocumentBuilder _core,
                            org.iso_relax.verifier.Schema _schema)
                     throws javax.xml.parsers.ParserConfigurationException
        Throws:
        javax.xml.parsers.ParserConfigurationException
    • Method Detail

      • getDOMImplementation

        public org.w3c.dom.DOMImplementation getDOMImplementation()
        Specified by:
        getDOMImplementation in class javax.xml.parsers.DocumentBuilder
      • isNamespaceAware

        public boolean isNamespaceAware()
        Specified by:
        isNamespaceAware in class javax.xml.parsers.DocumentBuilder
      • isValidating

        public boolean isValidating()
        Specified by:
        isValidating in class javax.xml.parsers.DocumentBuilder
      • newDocument

        public org.w3c.dom.Document newDocument()
        Specified by:
        newDocument in class javax.xml.parsers.DocumentBuilder
      • parse

        public org.w3c.dom.Document parse​(org.xml.sax.InputSource is)
                                   throws org.xml.sax.SAXException,
                                          java.io.IOException
        Specified by:
        parse in class javax.xml.parsers.DocumentBuilder
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • parse

        public org.w3c.dom.Document parse​(java.io.File f)
                                   throws org.xml.sax.SAXException,
                                          java.io.IOException
        Overrides:
        parse in class javax.xml.parsers.DocumentBuilder
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • parse

        public org.w3c.dom.Document parse​(java.io.InputStream is)
                                   throws org.xml.sax.SAXException,
                                          java.io.IOException
        Overrides:
        parse in class javax.xml.parsers.DocumentBuilder
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • parse

        public org.w3c.dom.Document parse​(java.io.InputStream is,
                                          java.lang.String systemId)
                                   throws org.xml.sax.SAXException,
                                          java.io.IOException
        Overrides:
        parse in class javax.xml.parsers.DocumentBuilder
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • parse

        public org.w3c.dom.Document parse​(java.lang.String url)
                                   throws org.xml.sax.SAXException,
                                          java.io.IOException
        Overrides:
        parse in class javax.xml.parsers.DocumentBuilder
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • setEntityResolver

        public void setEntityResolver​(org.xml.sax.EntityResolver resolver)
        Specified by:
        setEntityResolver in class javax.xml.parsers.DocumentBuilder
      • setErrorHandler

        public void setErrorHandler​(org.xml.sax.ErrorHandler handler)
        Specified by:
        setErrorHandler in class javax.xml.parsers.DocumentBuilder
      • verify

        private org.w3c.dom.Document verify​(org.w3c.dom.Document dom)
                                     throws org.xml.sax.SAXException,
                                            java.io.IOException
        Validates a given DOM and returns it if it is valid. Otherwise throw an exception.
        Throws:
        org.xml.sax.SAXException
        java.io.IOException