Package org.xmlresolver
Class StAXResolver
- java.lang.Object
-
- org.xmlresolver.StAXResolver
-
- All Implemented Interfaces:
javax.xml.stream.XMLResolver
public class StAXResolver extends java.lang.Object implements javax.xml.stream.XMLResolver
Implements theXMLResolver
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 thesetXMLResolver
method.Resolver
class because theresolveEntity
method of theXMLResolver
interface isn't compatible with theEntityResolver2
method of the same name.- See Also:
Resolver
-
-
Constructor Summary
Constructors Constructor Description StAXResolver()
Creates a new instance of StAXResolver.StAXResolver(ResourceResolver resolver)
Creates a new instance of a StAXResolver.StAXResolver(XMLResolverConfiguration config)
Creates a new instance of a StAXResolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolverConfiguration
getConfiguration()
Get the configuration used by this resolver.java.lang.Object
resolveEntity(java.lang.String publicId, java.lang.String systemId, java.lang.String baseURI, java.lang.String namespace)
Implements theXMLResolver
interface.
-
-
-
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 theXMLResolver
interface.- Specified by:
resolveEntity
in interfacejavax.xml.stream.XMLResolver
- Throws:
javax.xml.stream.XMLStreamException
-
-