Class StAXResolver

  • All Implemented Interfaces:
    javax.xml.stream.XMLResolver

    public class StAXResolver
    extends java.lang.Object
    implements javax.xml.stream.XMLResolver
    Implements the XMLResolver interface.

    This interface is used to resolve resources during an XML parse. If an application wishes to perform custom entity resolution it must register an instance of this interface with the XMLInputFactory using the setXMLResolver method.

    This class is distinct from the Resolver class because the resolveEntity method of the XMLResolver interface isn't compatible with the EntityResolver2 method of the same name.
    See Also:
    Resolver
    • Constructor Detail

      • StAXResolver

        public StAXResolver()
        Creates a new instance of StAXResolver. The default resolver is a new ResourceResolver that uses a static catalog shared by all threads.
      • StAXResolver

        public StAXResolver​(XMLResolverConfiguration config)
        Creates a new instance of a StAXResolver. Creates a resolver using a specific Catalog.
        Parameters:
        config - The XML Resolver configuration to use.
      • StAXResolver

        public StAXResolver​(ResourceResolver resolver)
        Creates a new instance of a StAXResolver. Creates a resolver using a specific underlying ResourceResolver.
        Parameters:
        resolver - The resource resolver to use.
    • Method Detail

      • getConfiguration

        public ResolverConfiguration getConfiguration()
        Get the configuration used by this resolver.
        Returns:
        The catalog
      • resolveEntity

        public java.lang.Object resolveEntity​(java.lang.String publicId,
                                              java.lang.String systemId,
                                              java.lang.String baseURI,
                                              java.lang.String namespace)
                                       throws javax.xml.stream.XMLStreamException
        Implements the XMLResolver interface.
        Specified by:
        resolveEntity in interface javax.xml.stream.XMLResolver
        Throws:
        javax.xml.stream.XMLStreamException