org.apache.tools.ant.types.resources

Class Tokens

public class Tokens extends BaseResourceCollectionWrapper

ResourceCollection consisting of StringResources gathered from tokenizing another ResourceCollection with a Tokenizer implementation.

Since: Ant 1.7

Method Summary
voidadd(Tokenizer tokenizer)
Add the nested Tokenizer to this Tokens ResourceCollection.
protected voiddieOnCircularReference(Stack stk, Project p)
Overrides the BaseResourceCollectionContainer version to check the nested Tokenizer.
protected CollectiongetCollection()
Sort the contained elements.
voidsetEncoding(String encoding)
Set the encoding used to create the tokens.

Method Detail

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)
Overrides the BaseResourceCollectionContainer version to check the nested Tokenizer.

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.

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.