Class PersistenceProductDerivation.ConfigurationParser

  • All Implemented Interfaces:
    MetaDataParser, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler
    Enclosing class:
    PersistenceProductDerivation

    public static class PersistenceProductDerivation.ConfigurationParser
    extends XMLMetaDataParser
    SAX handler capable of parsing an JPA persistence.xml file. Package-protected for testing.
    • Constructor Detail

      • ConfigurationParser

        public ConfigurationParser​(java.util.Map map)
    • Method Detail

      • parse

        public void parse​(java.net.URL url)
                   throws java.io.IOException
        Description copied from interface: MetaDataParser
        Parse the given resource.
        Specified by:
        parse in interface MetaDataParser
        Overrides:
        parse in class XMLMetaDataParser
        Throws:
        java.io.IOException
      • parse

        public void parse​(java.io.File file)
                   throws java.io.IOException
        Description copied from interface: MetaDataParser
        Parse the given file, which may be a directory, in which case it will be scanned recursively for metadata files.
        Specified by:
        parse in interface MetaDataParser
        Overrides:
        parse in class XMLMetaDataParser
        Throws:
        java.io.IOException
      • getSchemaSource

        protected java.lang.Object getSchemaSource()
        Description copied from class: XMLMetaDataParser
        Implement to return the XML schema source for the document. Returns null by default. May return:
        • String pointing to schema URI.
        • InputStream containing schema contents.
        • InputSource containing schema contents.
        • File containing schema contents.
        • Array of any of the above elements.
        Overrides:
        getSchemaSource in class XMLMetaDataParser
      • reset

        protected void reset()
        Description copied from class: XMLMetaDataParser
        Override this method to clear any state and ready the parser for a new document. Subclasses should call super.reset() to clear superclass state.
        Overrides:
        reset in class XMLMetaDataParser
      • startElement

        protected boolean startElement​(java.lang.String name,
                                       org.xml.sax.Attributes attrs)
                                throws org.xml.sax.SAXException
        Description copied from class: XMLMetaDataParser
        Override this method marking the start of some element. If this method returns false, the content of the element and the end element event will be ignored.
        Specified by:
        startElement in class XMLMetaDataParser
        Throws:
        org.xml.sax.SAXException
      • endElement

        protected void endElement​(java.lang.String name)
                           throws org.xml.sax.SAXException
        Description copied from class: XMLMetaDataParser
        Override this method marking the end of some element.
        Specified by:
        endElement in class XMLMetaDataParser
        Throws:
        org.xml.sax.SAXException