org.apache.tools.ant.types.resources

Class Tokens

Implemented Interfaces:
Cloneable, ResourceCollection

public class Tokens
extends BaseResourceCollectionWrapper

ResourceCollection consisting of StringResources gathered from tokenizing another ResourceCollection with a Tokenizer implementation.
Since:
Ant 1.7

Field Summary

Fields inherited from class org.apache.tools.ant.types.DataType

checked, ref

Fields inherited from class org.apache.tools.ant.ProjectComponent

description, location, project

Method Summary

void
add(Tokenizer tokenizer)
Add the nested Tokenizer to this Tokens ResourceCollection.
protected void
dieOnCircularReference(Stack stk, Project p)
Overrides the BaseResourceCollectionContainer version to check the nested Tokenizer.
protected Collection
getCollection()
Sort the contained elements.
void
setEncoding(String encoding)
Set the encoding used to create the tokens.

Methods inherited from class org.apache.tools.ant.types.resources.BaseResourceCollectionWrapper

add, dieOnCircularReference, getCollection, getResourceCollection, isCache, isFilesystemOnly, iterator, setCache, size, toString

Methods inherited from class org.apache.tools.ant.types.DataType

checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, toString, tooManyAttributes

Methods inherited from class org.apache.tools.ant.ProjectComponent

clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

Method Details

add

public void add(Tokenizer tokenizer)
Add the nested Tokenizer to this Tokens ResourceCollection. A LineTokenizer will be used by default.
Parameters:
tokenizer - the tokenizer to add.

dieOnCircularReference

protected void dieOnCircularReference(Stack stk,
                                      Project p)
            throws BuildException
Overrides the BaseResourceCollectionContainer version to check the nested Tokenizer.
Overrides:
dieOnCircularReference in interface BaseResourceCollectionWrapper
Parameters:
stk - the stack of data types to use (recursively).
p - the project to use to dereference the references.
Throws:
BuildException - on error.

getCollection

protected Collection getCollection()
Sort the contained elements.
Overrides:
getCollection in interface BaseResourceCollectionWrapper
Returns:
a Collection of Resources.

setEncoding

public void setEncoding(String encoding)
Set the encoding used to create the tokens.
Parameters:
encoding - the encoding to use.