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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    afterAllProcessed(boolean neededFormatting)
    Invoked after all files in the project have been processed.
    void
     
    protected abstract boolean
    Processes a single file found in the project.

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.MojoExecutionException
      org.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 process
      fmt - 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 parsed
      IOException - 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