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 Fileprivate final AbstractXmlMojo.CatalogHandlingprivate final org.codehaus.plexus.resource.ResourceManagerprivate final org.apache.xml.resolver.tools.CatalogResolverprivate booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate InputSourceasInputSource(URL url) private SourceasSaxSource(InputSource isource) (package private) StringfilterPossibleURI(String pResource) getExternalSubset(String name, String baseURI) Implementation ofEntityResolver2.getExternalSubset(String, String)booleanReturns, whether the Resolver should create validating parsers.booleanReturns, whether the transformer should create xinclude aware XML parsers for reading XML documents.private final LSInputnewLSInput(InputSource pSource) Attempts to resolve the given URI.Implementation ofURIResolver.resolve(String, String).private URLprivate URLresolveAsFile(String pResource) private URLresolveAsResource(String pResource) private URLresolveAsURL(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).voidsetValidating(boolean pValidating) Sets, whether the Resolver should create validating parsers.voidsetXincludeAware(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:
resolveEntityin interfaceEntityResolver- Throws:
SAXExceptionIOException
-
asInputSource
- Throws:
IOException
-
resolve
Implementation ofURIResolver.resolve(String, String).- Specified by:
resolvein 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:
resolveResourcein 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
-
resolve
-
getExternalSubset
Implementation ofEntityResolver2.getExternalSubset(String, String)- Specified by:
getExternalSubsetin interfaceEntityResolver2- Throws:
SAXExceptionIOException
-
resolveEntity
public InputSource resolveEntity(String pName, String pPublicId, String pBaseURI, String pSystemId) throws SAXException, IOException Implementation ofEntityResolver2.resolveEntity(String, String, String, String)- Specified by:
resolveEntityin interfaceEntityResolver2- Throws:
SAXExceptionIOException
-
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
-