Package org.apache.fop.tools
Class EventProducerCollectorTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.apache.fop.tools.EventProducerCollectorTask
-
- All Implemented Interfaces:
java.lang.Cloneable
public class EventProducerCollectorTask extends org.apache.tools.ant.TaskAnt task which inspects a file set for Java interfaces which extend theEventProducerinterface. 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 java.io.FiledestDirprivate java.util.List<org.apache.tools.ant.types.FileSet>filesetsprivate static java.lang.StringMERGETRANSLATIONprivate static java.lang.StringMODEL2TRANSLATIONprivate java.io.FiletranslationFile
-
Constructor Summary
Constructors Constructor Description EventProducerCollectorTask()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFileset(org.apache.tools.ant.types.FileSet set)Adds a file set.voidexecute()private java.io.FilegetParentDir(EventModel model)java.io.FilegetTranslationFile()Returns the translation file for the event producer methods.static voidmain(java.lang.String[] args)Command-line interface for testing purposes.protected longprocessFileSets(EventProducerCollector collector)Processes the file sets defined for the task.voidsetDestDir(java.io.File destDir)Sets the destination directory for the event models.voidsetTranslationFile(java.io.File f)Sets the translation file for the event producer methods.protected voidupdateTranslationFile(java.io.File modelFile)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
-
-
-
-
Field Detail
-
filesets
private java.util.List<org.apache.tools.ant.types.FileSet> filesets
-
destDir
private java.io.File destDir
-
translationFile
private java.io.File translationFile
-
MODEL2TRANSLATION
private static final java.lang.String MODEL2TRANSLATION
- See Also:
- Constant Field Values
-
MERGETRANSLATION
private static final java.lang.String MERGETRANSLATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
getParentDir
private java.io.File getParentDir(EventModel model)
-
updateTranslationFile
protected void updateTranslationFile(java.io.File modelFile) throws java.io.IOExceptionUpdates the translation file with new entries for newly found event producer methods.- Parameters:
modelFile- the model file to use- Throws:
java.io.IOException- if an I/O error occurs
-
processFileSets
protected long processFileSets(EventProducerCollector collector) throws java.io.IOException, EventConventionException, java.lang.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:
java.io.IOException- if an I/O error occursEventConventionException- if the EventProducer conventions are violatedjava.lang.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(java.io.File destDir)
Sets the destination directory for the event models.- Parameters:
destDir- the destination directory
-
setTranslationFile
public void setTranslationFile(java.io.File f)
Sets the translation file for the event producer methods.- Parameters:
f- the translation file
-
getTranslationFile
public java.io.File getTranslationFile()
Returns the translation file for the event producer methods.- Returns:
- the translation file
-
main
public static void main(java.lang.String[] args)
Command-line interface for testing purposes.- Parameters:
args- the command-line arguments
-
-