org.apache.tools.ant.utilClass StringTokenizer
- java.lang.Object
- org.apache.tools.ant.ProjectComponent
- org.apache.tools.ant.util.StringTokenizer
- All Implemented Interfaces:
- java.lang.Cloneable, Tokenizer
- Direct Known Subclasses:
- TokenFilter.StringTokenizer
public class StringTokenizer extends ProjectComponent implements TokenizerClass to tokenize the input as areas separated by white space, or by a specified list of delim characters. Behaves like java.util.StringTokenizer. If the stream starts with delim characters, the first token will be an empty string (unless the treat delims as tokens flag is set).
- Since:
- Ant 1.7
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
Constructor Summary
Constructors Constructor and Description StringTokenizer()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.String
getPostToken()
return the string between tokens, after the previous token.java.lang.String
getToken(java.io.Reader in)
find and return the next tokenvoid
setDelims(java.lang.String delims)
attribute delims - the delimiter charactersvoid
setDelimsAreTokens(boolean delimsAreTokens)
attribute delimsaretokens - treat delimiters as separate tokens.void
setIncludeDelims(boolean includeDelims)
attribute includedelims - treat delimiters as part of the token.void
setSuppressDelims(boolean suppressDelims)
attribute suppressdelims - suppress delimiters.
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
Method Detail
setDelims
public void setDelims(java.lang.String delims)attribute delims - the delimiter characters
- Parameters:
delims
- a string containing the delimiter characters
setDelimsAreTokens
public void setDelimsAreTokens(boolean delimsAreTokens)attribute delimsaretokens - treat delimiters as separate tokens.
- Parameters:
delimsAreTokens
- true if delimiters are to be separate
setSuppressDelims
public void setSuppressDelims(boolean suppressDelims)attribute suppressdelims - suppress delimiters. default - false
- Parameters:
suppressDelims
- if true do not report delimiters
setIncludeDelims
public void setIncludeDelims(boolean includeDelims)attribute includedelims - treat delimiters as part of the token. default - false
- Parameters:
includeDelims
- if true add delimiters to the token
getToken
public java.lang.String getToken(java.io.Reader in) throws java.io.IOExceptionfind and return the next token
getPostToken
public java.lang.String getPostToken()Description copied from interface:Tokenizer
return the string between tokens, after the previous token.
- Specified by:
getPostToken
in interfaceTokenizer
- Returns:
- the intratoken string