Package org.codehaus.mojo.xml
Class Resolver
java.lang.Object
org.codehaus.mojo.xml.Resolver
- All Implemented Interfaces:
URIResolver
,LSResourceResolver
,EntityResolver
,EntityResolver2
An implementation of
EntityResolver
, URIResolver
, and LSResourceResolver
, based
on the Apache catalog resolver.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final File
private final AbstractXmlMojo.CatalogHandling
private final org.codehaus.plexus.resource.ResourceManager
private final org.apache.xml.resolver.tools.CatalogResolver
private boolean
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate InputSource
asInputSource
(URL url) private Source
asSaxSource
(InputSource isource) (package private) String
filterPossibleURI
(String pResource) getExternalSubset
(String name, String baseURI) Implementation ofEntityResolver2.getExternalSubset(String, String)
boolean
Returns, whether the Resolver should create validating parsers.boolean
Returns, whether the transformer should create xinclude aware XML parsers for reading XML documents.private final LSInput
newLSInput
(InputSource pSource) Attempts to resolve the given URI.Implementation ofURIResolver.resolve(String, String)
.private URL
private URL
resolveAsFile
(String pResource) private URL
resolveAsResource
(String pResource) private URL
resolveAsURL
(String pResource, URI pBaseURI) resolveEntity
(String pPublicId, String pSystemId) Implementation ofEntityResolver.resolveEntity(String, String)
.resolveEntity
(String pName, String pPublicId, String pBaseURI, String pSystemId) Implementation ofEntityResolver2.resolveEntity(String, String, String, String)
resolveResource
(String pType, String pNamespaceURI, String pPublicId, String pSystemId, String pBaseURI) Implementation ofLSResourceResolver.resolveResource(String, String, String, String, String)
.void
setValidating
(boolean pValidating) Sets, whether the Resolver should create validating parsers.void
setXincludeAware
(boolean pXIncludeAware) Sets, whether the transformer should create xinclude aware XML parsers for reading XML documents.
-
Field Details
-
locator
private final org.codehaus.plexus.resource.ResourceManager locator -
baseDir
-
resolver
private final org.apache.xml.resolver.tools.CatalogResolver resolver -
validating
private boolean validating -
xincludeAware
private boolean xincludeAware -
catalogHandling
-
-
Constructor Details
-
Resolver
Resolver(File pBaseDir, List<File> pFiles, List<URL> pUrls, org.codehaus.plexus.resource.ResourceManager pLocator, AbstractXmlMojo.CatalogHandling catalogHandling, boolean pLogging) throws org.apache.maven.plugin.MojoExecutionException Creates a new instance.- Parameters:
pFiles
- A set of files with catalog definitions to load- Throws:
org.apache.maven.plugin.MojoExecutionException
- An error occurred while loading the resolvers catalogs.
-
-
Method Details
-
resolveEntity
public InputSource resolveEntity(String pPublicId, String pSystemId) throws SAXException, IOException Implementation ofEntityResolver.resolveEntity(String, String)
.- Specified by:
resolveEntity
in interfaceEntityResolver
- Throws:
SAXException
IOException
-
asInputSource
- Throws:
IOException
-
resolve
Implementation ofURIResolver.resolve(String, String)
.- Specified by:
resolve
in interfaceURIResolver
- Throws:
TransformerException
-
asSaxSource
-
newLSInput
-
resolveResource
public LSInput resolveResource(String pType, String pNamespaceURI, String pPublicId, String pSystemId, String pBaseURI) Implementation ofLSResourceResolver.resolveResource(String, String, String, String, String)
.- Specified by:
resolveResource
in interfaceLSResourceResolver
-
setValidating
public void setValidating(boolean pValidating) Sets, whether the Resolver should create validating parsers.- Parameters:
pValidating
- True, if created parsers should validate. Otherwise false.
-
isValidating
public boolean isValidating()Returns, whether the Resolver should create validating parsers.- Returns:
- True, if created parsers should validate. Otherwise false.
-
resolveAsResource
-
resolveAsFile
-
resolveAsURL
-
resolve
Attempts to resolve the given URI.- Parameters:
pResource
- The URI to resolve.- Returns:
- The URL, which is being referred to by the URI. Null, if no such URL can be found.
-
resolve
-
getExternalSubset
Implementation ofEntityResolver2.getExternalSubset(String, String)
- Specified by:
getExternalSubset
in interfaceEntityResolver2
- Throws:
SAXException
IOException
-
resolveEntity
public InputSource resolveEntity(String pName, String pPublicId, String pBaseURI, String pSystemId) throws SAXException, IOException Implementation ofEntityResolver2.resolveEntity(String, String, String, String)
- Specified by:
resolveEntity
in interfaceEntityResolver2
- Throws:
SAXException
IOException
-
isXincludeAware
public boolean isXincludeAware()Returns, whether the transformer should create xinclude aware XML parsers for reading XML documents. The default value is false.- Returns:
- True, if transformers parser should be xinclud aware. Otherwise false.
-
setXincludeAware
public void setXincludeAware(boolean pXIncludeAware) Sets, whether the transformer should create xinclude aware XML parsers for reading XML documents. The default value is false.- Parameters:
pXIncludeAware
- True, if transformers parser should be xinclud aware. Otherwise false.
-
filterPossibleURI
-