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:
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 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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFileset
(org.apache.tools.ant.types.FileSet set) Adds a file set.void
execute()
private File
getParentDir
(EventModel model) Returns the translation file for the event producer methods.static void
Command-line interface for testing purposes.protected long
processFileSets
(EventProducerCollector collector) 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
updateTranslationFile
(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
Methods 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:
execute
in 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
-