Class XmlFormatPlugin
java.lang.Object
org.apache.maven.plugin.AbstractMojo
au.com.acegi.xmlformat.AbstractXmlPlugin
au.com.acegi.xmlformat.XmlFormatPlugin
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
@Mojo(name="xml-format",
defaultPhase=PREPARE_PACKAGE,
threadSafe=true)
public final class XmlFormatPlugin
extends AbstractXmlPlugin
Finds the XML files in a project and automatically reformats them.
-
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterAllProcessed(boolean neededFormatting) Invoked after all files in the project have been processed.protected booleanprocessFile(File input, XmlOutputFormat fmt) Processes a single file found in the project.Methods inherited from class AbstractXmlPlugin
executeMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
XmlFormatPlugin
public XmlFormatPlugin()
-
-
Method Details
-
processFile
protected boolean processFile(File input, XmlOutputFormat fmt) throws org.dom4j.DocumentException, IOException Description copied from class:AbstractXmlPluginProcesses a single file found in the project.- Specified by:
processFilein classAbstractXmlPlugin- 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 void afterAllProcessed(boolean neededFormatting) Description copied from class:AbstractXmlPluginInvoked after all files in the project have been processed.- Specified by:
afterAllProcessedin classAbstractXmlPlugin- Parameters:
neededFormatting- whether any processed file required changes to match the formatting style
-