net.uworks.andariel
Class Count

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bynet.uworks.andariel.Count

public class Count
extends org.apache.tools.ant.Task

Task definition for an ANT task that counts a sequance delimited by a certain character.


 Usage:

   Task declaration in the project:
   
     <taskdef name="count" classname="net.uworks.andariel.Count" />
   

   Task calling syntax:
    
     <count [param="param"] [value="value"] outputproperty="property" [delimiter="delimiter"] />
    


   Attributes:
       param           -> The name of the property to count (this or value must be defined)
       value           -> The value to count (this or param must be defined)
       outputproperty  -> The name of the property to place the result (optional)
       delimiter       -> The delimiter character or sequence (default is ",")


 Crude Example:

     
     <count value="test1, test2, test3" outputProperty="propertyName" />
     

 

Since:
Ant 1.5
Version:
$Revision: 1.0 $
Author:
Josep del Rio

Field Summary
 
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
Count()
           
 
Method Summary
 void execute()
          Execute this task.
 void setDelimiter(java.lang.String delimiter)
          Set the delimiter character/characters of each one of the values we want to count.
 void setOutputproperty(java.lang.String outputproperty)
          Set the name of the property where we place the result.
 void setParam(java.lang.String param)
          Set the name of the property that contains the sequence to count.
 void setValue(java.lang.String value)
          Set the value we want to count.
 
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
 

Constructor Detail

Count

public Count()
Method Detail

execute

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

Throws:
org.apache.tools.ant.BuildException - Description of the Exception

setParam

public void setParam(java.lang.String param)
Set the name of the property that contains the sequence to count.

Parameters:
param - the property to count.

setValue

public void setValue(java.lang.String value)
Set the value we want to count.

Parameters:
value - the string we want to count.

setOutputproperty

public void setOutputproperty(java.lang.String outputproperty)
Set the name of the property where we place the result.

Parameters:
outputproperty - the property to place the result.

setDelimiter

public void setDelimiter(java.lang.String delimiter)
Set the delimiter character/characters of each one of the values we want to count.

Parameters:
delimiter - the values delimiter.