Class XmlMetaDataEntityResolver

  • All Implemented Interfaces:
    org.xml.sax.EntityResolver

    public class XmlMetaDataEntityResolver
    extends java.lang.Object
    implements org.xml.sax.EntityResolver
    Implementation of an entity resolver for XML MetaData files. Supports a series of internally supported public or system identities. Note that this applies to ALL types of XML MetaData (persistence.xml, JDO package.jdo, JDO package.orm, JDO package.jdoquery, JPA/Jakarta orm.xml). We could, potentially, separate these different types of MetaData XML file, and hence split up the entities based on the handler, but not considered a priority currently.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) PluginManager pluginMgr  
      protected java.util.Map<java.lang.String,​java.lang.String> publicIdEntities
      Map of public identity entities supported.
      protected java.util.Map<java.lang.String,​java.lang.String> systemIdEntities
      Map of system identity entities supported.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.xml.sax.InputSource getLocalInputSource​(java.lang.String publicId, java.lang.String systemId, java.lang.String localPath)
      Accessor for the input source for a path.
      javax.xml.transform.Source[] getRegisteredSchemas()
      The list of schemas registered in the plugin "metadata_entityresolver".
      org.xml.sax.InputSource resolveEntity​(java.lang.String publicId, java.lang.String systemId)
      Method to resolve XML entities.
      • Methods inherited from class java.lang.Object

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

      • publicIdEntities

        protected java.util.Map<java.lang.String,​java.lang.String> publicIdEntities
        Map of public identity entities supported. The key will be the identity, and the value is the local input to use.
      • systemIdEntities

        protected java.util.Map<java.lang.String,​java.lang.String> systemIdEntities
        Map of system identity entities supported. The key will be the identity, and the value is the local input to use.
    • Constructor Detail

      • XmlMetaDataEntityResolver

        public XmlMetaDataEntityResolver​(PluginManager pluginMgr)
    • Method Detail

      • getRegisteredSchemas

        public javax.xml.transform.Source[] getRegisteredSchemas()
        The list of schemas registered in the plugin "metadata_entityresolver".
        Returns:
        the Sources pointing to the .xsd files
      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String publicId,
                                                     java.lang.String systemId)
                                              throws org.xml.sax.SAXException
        Method to resolve XML entities. Allows for the internally supported public and system identity entities.
        Specified by:
        resolveEntity in interface org.xml.sax.EntityResolver
        Parameters:
        publicId - The public id.
        systemId - The system id.
        Returns:
        Input Source for the URI.
        Throws:
        org.xml.sax.SAXException
        See Also:
        EntityResolver.resolveEntity(java.lang.String,java.lang.String)
      • getLocalInputSource

        protected org.xml.sax.InputSource getLocalInputSource​(java.lang.String publicId,
                                                              java.lang.String systemId,
                                                              java.lang.String localPath)
                                                       throws java.io.FileNotFoundException
        Accessor for the input source for a path.
        Parameters:
        publicId - Public identity
        systemId - System identity
        localPath - The local path
        Returns:
        The input source
        Throws:
        java.io.FileNotFoundException - if the local file is not accessible