Class AbstractXmlPlugin
java.lang.Object
org.apache.maven.plugin.AbstractMojo
au.com.acegi.xmlformat.AbstractXmlPlugin
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
XmlCheckPlugin, XmlFormatPlugin
public abstract class AbstractXmlPlugin
extends org.apache.maven.plugin.AbstractMojo
Common infrastructure for the various plugin goals.
-
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidafterAllProcessed(boolean neededFormatting) Invoked after all files in the project have been processed.voidexecute()protected abstract booleanprocessFile(File input, XmlOutputFormat fmt) Processes a single file found in the project.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
AbstractXmlPlugin
public AbstractXmlPlugin()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
processFile
protected abstract boolean processFile(File input, XmlOutputFormat fmt) throws org.dom4j.DocumentException, IOException Processes a single file found in the project.- Parameters:
input- the file to processfmt- the formatting options- Returns:
- true if the file required changes to match the formatting style
- Throws:
org.dom4j.DocumentException- if input XML could not be parsedIOException- if output XML stream could not be written
-
afterAllProcessed
protected abstract void afterAllProcessed(boolean neededFormatting) throws org.apache.maven.plugin.MojoExecutionException Invoked after all files in the project have been processed.- Parameters:
neededFormatting- whether any processed file required changes to match the formatting style- Throws:
org.apache.maven.plugin.MojoExecutionException- if the build must be failed
-