Class Tokens

All Implemented Interfaces:
Cloneable, Iterable<Resource>, ResourceCollection

public class Tokens extends BaseResourceCollectionWrapper
ResourceCollection consisting of StringResources gathered from tokenizing another ResourceCollection with a Tokenizer implementation.
Since:
Ant 1.7
  • Constructor Details

    • Tokens

      public Tokens()
  • Method Details

    • getCollection

      protected Collection<Resource> getCollection()
      Sort the contained elements.
      Specified by:
      getCollection in class 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.
    • 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<Object> stk, Project p) throws BuildException
      Overrides the BaseResourceCollectionContainer version to check the nested Tokenizer.
      Overrides:
      dieOnCircularReference in class AbstractResourceCollectionWrapper
      Parameters:
      stk - the stack of data types to use (recursively).
      p - the project to use to dereference the references.
      Throws:
      BuildException - on error.