Package org.codehaus.mojo.xml
Class AbstractXmlMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.xml.AbstractXmlMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CheckFormatMojo
,TransformMojo
,ValidateMojo
public abstract class AbstractXmlMojo
extends org.apache.maven.plugin.AbstractMojo
Abstract base class for the plugins Mojo's.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate File
The base directory, relative to which directory names are interpreted.private AbstractXmlMojo.CatalogHandling
How to handle entities which cannot be found in any catalog.private String[]
An XML catalog file, or URL, which is being used to resolve entities.private org.codehaus.plexus.resource.ResourceManager
Plexus resource manager used to obtain XSL.private boolean
private org.apache.maven.project.MavenProject
The Maven Project.private org.apache.maven.settings.Settings
The Maven Settings.private boolean
Whether to skip execution.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
Called to install the plugins proxy settings.protected File
Converts the given file into an file with an absolute path.protected File[]
Converts the given set of file names into a set ofFile
instances.(package private) void
protected File
Returns the projects base directory.protected AbstractXmlMojo.CatalogHandling
protected String[]
getExcludes
(String[] origExcludes, boolean skipDefaultExcludes) Calculates the exclusions to use when searching files.protected String[]
getFileNames
(File pDir, String[] pIncludes, String[] pExcludes) Scans a directory for files and returns a set of path names.protected File[]
Scans a directory for files and returns a set ofFile
instances.protected org.codehaus.plexus.resource.ResourceManager
protected org.apache.maven.project.MavenProject
Returns the maven project.protected Resolver
Creates a new resolver.protected URL
getResource
(String pResource) private boolean
protected boolean
protected void
passivateProxy
(Object pProperties) Called to restore the proxy settings, which have been installed when the plugin was invoked.protected void
setCatalogs
(List<File> pCatalogFiles, List<URL> pCatalogUrls) Returns the plugins catalog files.private void
setProperty
(List<String> pProperties, String pKey, String pValue) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) private org.apache.maven.project.MavenProject projectThe Maven Project. -
settings
@Parameter(defaultValue="${settings}", required=true, readonly=true) private org.apache.maven.settings.Settings settingsThe Maven Settings. -
basedir
The base directory, relative to which directory names are interpreted. -
skip
@Parameter(property="xml.skip", defaultValue="false") private boolean skipWhether to skip execution. -
catalogs
An XML catalog file, or URL, which is being used to resolve entities. -
catalogHandling
@Parameter(property="xml.catalogHandling", defaultValue="passThrough") private AbstractXmlMojo.CatalogHandling catalogHandlingHow to handle entities which cannot be found in any catalog. -
locator
@Component private org.codehaus.plexus.resource.ResourceManager locatorPlexus resource manager used to obtain XSL. -
locatorInitialized
private boolean locatorInitialized
-
-
Constructor Details
-
AbstractXmlMojo
public AbstractXmlMojo()
-
-
Method Details
-
getProject
protected org.apache.maven.project.MavenProject getProject()Returns the maven project. -
getBasedir
Returns the projects base directory. -
asAbsoluteFile
Converts the given file into an file with an absolute path. -
setCatalogs
protected void setCatalogs(List<File> pCatalogFiles, List<URL> pCatalogUrls) throws org.apache.maven.plugin.MojoExecutionException Returns the plugins catalog files.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getResolver
Creates a new resolver.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getFileNames
protected String[] getFileNames(File pDir, String[] pIncludes, String[] pExcludes) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException Scans a directory for files and returns a set of path names.- Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
asFiles
Converts the given set of file names into a set ofFile
instances. The file names may be relative to the given base directory. -
getFiles
protected File[] getFiles(File pDir, String[] pIncludes, String[] pExcludes) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException Scans a directory for files and returns a set ofFile
instances.- Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
getExcludes
Calculates the exclusions to use when searching files. -
isEmpty
-
setProperty
-
activateProxy
Called to install the plugins proxy settings. -
passivateProxy
Called to restore the proxy settings, which have been installed when the plugin was invoked. -
getResource
- Throws:
org.apache.maven.plugin.MojoFailureException
-
getLocator
protected org.codehaus.plexus.resource.ResourceManager getLocator() -
isSkipping
protected boolean isSkipping() -
checkCatalogHandling
void checkCatalogHandling() throws org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoFailureException
-
getCatalogHandling
-