Class EventProducerCollectorTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.fop.eventtools.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
FieldsModifier and TypeFieldDescriptionprivate Fileprivate List<org.apache.tools.ant.types.FileSet> private static final Stringprivate static final Stringprivate FileFields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFileset(org.apache.tools.ant.types.FileSet set) Adds a file set.voidexecute()private FilegetParentDir(EventModel model) Returns the translation file for the event producer methods.static voidCommand-line interface for testing purposes.protected longprocessFileSets(EventProducerCollector collector) Processes the file sets defined for the task.voidsetDestDir(File destDir) Sets the destination directory for the event models.voidSets the translation file for the event producer methods.protected voidupdateTranslationFile(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, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
filesets
-
destDir
-
translationFile
-
MODEL2TRANSLATION
- See Also:
-
MERGETRANSLATION
- See Also:
-
-
Constructor Details
-
EventProducerCollectorTask
public EventProducerCollectorTask()
-
-
Method Details
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
getParentDir
-
updateTranslationFile
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 occursEventConventionException- if the EventProducer conventions are violatedClassNotFoundException- 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
Sets the destination directory for the event models.- Parameters:
destDir- the destination directory
-
setTranslationFile
Sets the translation file for the event producer methods.- Parameters:
f- the translation file
-
getTranslationFile
Returns the translation file for the event producer methods.- Returns:
- the translation file
-
main
Command-line interface for testing purposes.- Parameters:
args- the command-line arguments
-