|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--net.cafebabe.sat.util.FileTask | +--net.cafebabe.sat.xml.WordCountTask
Count words in an XML document.
Nested Class Summary | |
(package private) class |
WordCountTask.Handler
A class to handle content and parsing errors. |
Field Summary | |
(package private) java.util.List |
excludeElements
The list of elements to exclude |
(package private) static java.lang.String |
FILE
The file prefix for system ID |
(package private) WordCountTask.Handler |
handler
The handler |
(package private) java.util.List |
include
The include stack (indicates if should include current element) |
(package private) java.util.Map |
includeAttributes
The map of attributes to include (sorted by elements) |
(package private) int |
nbFiles
The number of files |
(package private) int |
nbWords
The number of words in the document being parsed |
(package private) javax.xml.parsers.SAXParser |
parser
The SAX parser |
(package private) java.lang.String |
property
The property for the number of words |
(package private) java.lang.String |
propertyFiles
The property for the number of files |
(package private) boolean |
quiet
Quiet flag (no message) |
(package private) java.lang.String |
separators
The set of separator characters (between two words) |
(package private) java.util.List |
singleElements
The list of elements which content is a single word |
Fields inherited from class net.cafebabe.sat.util.FileTask |
|
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 | |
WordCountTask()
Creates a new WordCountTask instance. |
Method Summary | |
void |
execute()
Execute the task. |
void |
setDocumentProperties(java.lang.String file)
Load a properties file defining document properties, that is the lists of elements to exclude, single elements, attributes to include and separator characters. |
void |
setExcludeElements(java.lang.String excludeList)
Set the list of excluded elements from the word count. |
void |
setIncludeAttributes(java.lang.String includeList)
Set the list of attributes to include as a coma separated list. |
void |
setProperty(java.lang.String property)
Set the property where the word count is put. |
void |
setPropertyFiles(java.lang.String propertyFiles)
Set the property where to put the file count. |
void |
setQuiet(boolean quiet)
Indicates if the task should be quiet (no message for word and file count). |
void |
setSeparators(java.lang.String separators)
Set the separator character list. |
void |
setSingleElements(java.lang.String singleList)
Set the list of elements which content is considered a single word. |
Methods inherited from class net.cafebabe.sat.util.FileTask |
addFileset, getFiles, setDir, setFile |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
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 |
static final java.lang.String FILE
java.lang.String separators
javax.xml.parsers.SAXParser parser
WordCountTask.Handler handler
java.util.List excludeElements
java.util.List singleElements
java.util.Map includeAttributes
java.util.List include
int nbWords
int nbFiles
java.lang.String property
java.lang.String propertyFiles
boolean quiet
Constructor Detail |
public WordCountTask() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
WordCountTask
instance.
javax.xml.parsers.ParserConfigurationException
- if an error occurs
org.xml.sax.SAXException
- if an error occursMethod Detail |
public void setSeparators(java.lang.String separators)
separators
- The list of separators as a String
.public void setExcludeElements(java.lang.String excludeList)
excludeList
- The coma separated list of elements to exclude as
a String
.public void setSingleElements(java.lang.String singleList)
singleList
- The coma separated list of single elements.public void setIncludeAttributes(java.lang.String includeList)
includeList
- The coma separated list of attributes.public void setDocumentProperties(java.lang.String file)
file
- The properties file as a String
.public void setProperty(java.lang.String property)
property
- The property to set.public void setPropertyFiles(java.lang.String propertyFiles)
propertyFiles
- The property to set.public void setQuiet(boolean quiet)
quiet
- The quiet flag.public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |