|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.jmw.tzap.TextZapTask
public class TextZapTask
Ant Task designed to run Filters on a set of documents
AbstractFilter,
FilterFile| Field Summary | |
|---|---|
protected java.io.File |
destDir
The output directory |
protected java.lang.String |
fileEncoding
File encoding defaults to the system property |
protected java.util.TreeMap |
fileMap
Map of the files to be processed |
protected FilterFile[] |
files
The files to be processed |
protected java.util.ArrayList<org.apache.tools.ant.types.FileSet> |
filesets
FileSets added to this task |
protected java.util.ArrayList |
filterCollection
Collection of filters added to this task |
protected AbstractFilter[] |
filters
An array of the filters added to this task |
protected java.io.File |
inFile
The input file |
protected org.apache.tools.ant.types.Mapper |
mapperElement
Filename mapper |
protected java.io.File |
outFile
The output file |
protected boolean |
overwrite
Overwrite flag |
protected FileSaver |
saver
Custom saver, optional |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
description, location, target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
project |
| Constructor Summary | |
|---|---|
TextZapTask()
Constructor for the TextZapTask object |
|
| Method Summary | |
|---|---|
void |
add(AbstractFilter filter)
Adds an output filter |
void |
addConfigured(FileSaver saver)
|
void |
addConfiguredFilter(Filter filter)
Adds an output filter |
void |
addFileSet(org.apache.tools.ant.types.FileSet fs)
adds a fileset |
protected void |
assembleFiles()
Goes through each FileSet and adds its files to the fileSet map and ultimately to the files array. |
protected void |
buildMap(java.io.File fromDir,
java.io.File toDir,
java.lang.String[] names,
org.apache.tools.ant.util.FileNameMapper mapper)
Compares source files to destination files to see if they should be copied, if the overwrite flag is false. |
protected org.apache.tools.ant.util.FileNameMapper |
chooseMapper()
Selects the proper mapper. |
org.apache.tools.ant.types.Mapper |
createMapper()
Defines a mapper to map source to destination files. |
void |
execute()
Execute the task by calling the execute method of each Filter |
void |
setDestDir(java.io.File s)
sets the output directory |
void |
setEncoding(java.lang.String s)
sets the file encoding |
void |
setInFile(java.io.File s)
sets a single file for analysis |
void |
setOutFile(java.io.File s)
sets the output file |
void |
setOverwrite(boolean o)
sets overwrite flag. |
protected void |
validateAttributes()
Ensure we have a consistent and legal set of attributes, and be sure that each Filters has the correct attributes. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
getProject, setProject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.ArrayList<org.apache.tools.ant.types.FileSet> filesets
protected java.util.ArrayList filterCollection
protected AbstractFilter[] filters
protected FilterFile[] files
protected java.util.TreeMap fileMap
protected java.io.File inFile
protected java.io.File outFile
protected java.io.File destDir
protected boolean overwrite
protected java.lang.String fileEncoding
protected org.apache.tools.ant.types.Mapper mapperElement
protected FileSaver saver
| Constructor Detail |
|---|
public TextZapTask()
| Method Detail |
|---|
public void setInFile(java.io.File s)
s - the name of the filepublic void setOutFile(java.io.File s)
s - the filepublic void setDestDir(java.io.File s)
s - the filepublic void setEncoding(java.lang.String s)
s - the file encodingpublic void addConfiguredFilter(Filter filter)
filter - the object that creates the filterspublic void add(AbstractFilter filter)
filter - the object that creates the filterspublic void addFileSet(org.apache.tools.ant.types.FileSet fs)
fs - the files sets to be analyzedpublic void setOverwrite(boolean o)
o - the overwrite value
public org.apache.tools.ant.types.Mapper createMapper()
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException - Description of the Exceptionpublic void addConfigured(FileSaver saver)
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException - if the processing fails
protected void validateAttributes()
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException - if the processing fails
protected void assembleFiles()
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException - if something goes wrongprotected org.apache.tools.ant.util.FileNameMapper chooseMapper()
protected void buildMap(java.io.File fromDir,
java.io.File toDir,
java.lang.String[] names,
org.apache.tools.ant.util.FileNameMapper mapper)
fromDir - Description of the ParametertoDir - Description of the Parameternames - Description of the Parametermapper - Description of the Parameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||