net.cafebabe.sat.xml
Class WordCountTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--net.cafebabe.sat.util.FileTask
                    |
                    +--net.cafebabe.sat.xml.WordCountTask

public class WordCountTask
extends FileTask

Count words in an XML document.

Author:
Michel CASABIANCA

Field Summary
 
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, getNewFiles, newerFilesThan, 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
 

Constructor Detail

WordCountTask

public WordCountTask()
              throws javax.xml.parsers.ParserConfigurationException,
                     org.xml.sax.SAXException
Creates a new WordCountTask instance.

Throws:
javax.xml.parsers.ParserConfigurationException - if an error occurs
org.xml.sax.SAXException - if an error occurs
Method Detail

setSeparators

public void setSeparators(java.lang.String separators)
Set the separator character list.

Parameters:
separators - The list of separators as a String.

setExcludeElements

public void setExcludeElements(java.lang.String excludeList)
Set the list of excluded elements from the word count. The words contained in such elements are ignored.

Parameters:
excludeList - The coma separated list of elements to exclude as a String.

setSingleElements

public void setSingleElements(java.lang.String singleList)
Set the list of elements which content is considered a single word.

Parameters:
singleList - The coma separated list of single elements.

setIncludeAttributes

public void setIncludeAttributes(java.lang.String includeList)
Set the list of attributes to include as a coma separated list. Each attribute is noted as "element@attribute".

Parameters:
includeList - The coma separated list of attributes.

setDocumentProperties

public 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.

Parameters:
file - The properties file as a String.

setProperty

public void setProperty(java.lang.String property)
Set the property where the word count is put.

Parameters:
property - The property to set.

setPropertyFiles

public void setPropertyFiles(java.lang.String propertyFiles)
Set the property where to put the file count.

Parameters:
propertyFiles - The property to set.

setQuiet

public void setQuiet(boolean quiet)
Indicates if the task should be quiet (no message for word and file count).

Parameters:
quiet - The quiet flag.

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Execute the task.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - if an error occurs