Class EventProducerCollectorTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.fop.tools.EventProducerCollectorTask
All Implemented Interfaces:
Cloneable

public class EventProducerCollectorTask extends org.apache.tools.ant.Task
Ant task which inspects a file set for Java interfaces which extend the EventProducer interface. For all such interfaces an event model file and a translation file for the human-readable messages generated by the events is created and/or updated.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private File
     
    private List<org.apache.tools.ant.types.FileSet>
     
    private static final String
     
    private static final String
     
    private File
     

    Fields inherited from class org.apache.tools.ant.Task

    target, taskName, taskType, wrapper

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFileset(org.apache.tools.ant.types.FileSet set)
    Adds a file set.
    void
    private File
     
    Returns the translation file for the event producer methods.
    static void
    main(String[] args)
    Command-line interface for testing purposes.
    protected long
    Processes the file sets defined for the task.
    void
    setDestDir(File destDir)
    Sets the destination directory for the event models.
    void
    Sets the translation file for the event producer methods.
    protected void
    Updates the translation file with new entries for newly found event producer methods.

    Methods inherited from class org.apache.tools.ant.Task

    bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • filesets

      private List<org.apache.tools.ant.types.FileSet> filesets
    • destDir

      private File destDir
    • translationFile

      private File translationFile
    • MODEL2TRANSLATION

      private static final String MODEL2TRANSLATION
      See Also:
    • MERGETRANSLATION

      private static final String MERGETRANSLATION
      See Also:
  • Constructor Details

    • EventProducerCollectorTask

      public EventProducerCollectorTask()
  • Method Details

    • execute

      public void execute() throws org.apache.tools.ant.BuildException
      Overrides:
      execute in class org.apache.tools.ant.Task
      Throws:
      org.apache.tools.ant.BuildException
    • getParentDir

      private File getParentDir(EventModel model)
    • updateTranslationFile

      protected void updateTranslationFile(File modelFile) throws IOException
      Updates the translation file with new entries for newly found event producer methods.
      Parameters:
      modelFile - the model file to use
      Throws:
      IOException - if an I/O error occurs
    • processFileSets

      protected long processFileSets(EventProducerCollector collector) throws IOException, EventConventionException, ClassNotFoundException
      Processes the file sets defined for the task.
      Parameters:
      collector - the collector to use for collecting the event producers
      Returns:
      the time of the latest modification of any of the files inspected
      Throws:
      IOException - if an I/O error occurs
      EventConventionException - if the EventProducer conventions are violated
      ClassNotFoundException - if a required class cannot be found
    • addFileset

      public void addFileset(org.apache.tools.ant.types.FileSet set)
      Adds a file set.
      Parameters:
      set - the file set
    • setDestDir

      public void setDestDir(File destDir)
      Sets the destination directory for the event models.
      Parameters:
      destDir - the destination directory
    • setTranslationFile

      public void setTranslationFile(File f)
      Sets the translation file for the event producer methods.
      Parameters:
      f - the translation file
    • getTranslationFile

      public File getTranslationFile()
      Returns the translation file for the event producer methods.
      Returns:
      the translation file
    • main

      public static void main(String[] args)
      Command-line interface for testing purposes.
      Parameters:
      args - the command-line arguments