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.XMLResolverImplements theXMLResolverinterface.
This class is distinct from theThis 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
XMLInputFactoryusing thesetXMLResolvermethod.Resolverclass because theresolveEntitymethod of theXMLResolverinterface isn't compatible with theEntityResolver2method 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 ResolverConfigurationgetConfiguration()Get the configuration used by this resolver.java.lang.ObjectresolveEntity(java.lang.String publicId, java.lang.String systemId, java.lang.String baseURI, java.lang.String namespace)Implements theXMLResolverinterface.
-
-
-
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.XMLStreamExceptionImplements theXMLResolverinterface.- Specified by:
resolveEntityin interfacejavax.xml.stream.XMLResolver- Throws:
javax.xml.stream.XMLStreamException
-
-