Top Description Fields Constructors Methods
org.apache.tools.ant.util

public Class StringTokenizer

extends ProjectComponent
implements Tokenizer
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.util.Tokenizer
Known Direct Subclasses
org.apache.tools.ant.filters.TokenFilter.StringTokenizer
Imports
java.io.IOException, .Reader, org.apache.tools.ant.ProjectComponent

Class 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

Modifier and TypeField and Description
private char[]
private boolean
private boolean
private String
private static final int
private int
private boolean
Inherited from org.apache.tools.ant.ProjectComponent:
descriptionlocationproject

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the intratoken string
getPostToken
()

Implements org.apache.tools.ant.util.Tokenizer.getPostToken.

return the string between tokens, after the previous token.
public String

Returns:

the token
getToken
(Reader
the input stream
in
)

Implements org.apache.tools.ant.util.Tokenizer.getToken.

find and return the next token
private boolean
isDelim(char ch)

public void
setDelims(String
a string containing the delimiter characters
delims
)

attribute delims - the delimiter characters

public void
setDelimsAreTokens(boolean
true if delimiters are to be separate
delimsAreTokens
)

attribute delimsaretokens - treat delimiters as separate tokens.

public void
setIncludeDelims(boolean
if true add delimiters to the token
includeDelims
)

attribute includedelims - treat delimiters as part of the token.

public void
setSuppressDelims(boolean
if true do not report delimiters
suppressDelims
)

attribute suppressdelims - suppress delimiters.

Inherited from org.apache.tools.ant.ProjectComponent:
clonegetDescriptiongetLocationgetProjectloglogsetDescriptionsetLocationsetProject

Field Detail

delimsback to summary
private char[] delims
delimsAreTokensback to summary
private boolean delimsAreTokens
includeDelimsback to summary
private boolean includeDelims
intraStringback to summary
private String intraString
NOT_A_CHARback to summary
private static final int NOT_A_CHAR
pushedback to summary
private int pushed
suppressDelimsback to summary
private boolean suppressDelims

Constructor Detail

StringTokenizerback to summary
public StringTokenizer()

Method Detail

getPostTokenback to summary
public String getPostToken()

Implements org.apache.tools.ant.util.Tokenizer.getPostToken.

Doc from org.apache.tools.ant.util.Tokenizer.getPostToken.

return the string between tokens, after the previous token.

Returns:String

the intratoken string

Annotations
@Override
getTokenback to summary
public String getToken(Reader in) throws IOException

Implements org.apache.tools.ant.util.Tokenizer.getToken.

find and return the next token

Parameters
in:Reader

the input stream

Returns:String

the token

Exceptions
IOException:
if an error occurs reading
isDelimback to summary
private boolean isDelim(char ch)
setDelimsback to summary
public void setDelims(String delims)

attribute delims - the delimiter characters

Parameters
delims:String

a string containing the delimiter characters

setDelimsAreTokensback to summary
public void setDelimsAreTokens(boolean delimsAreTokens)

attribute delimsaretokens - treat delimiters as separate tokens.

Parameters
delimsAreTokens:boolean

true if delimiters are to be separate

setIncludeDelimsback to summary
public void setIncludeDelims(boolean includeDelims)

attribute includedelims - treat delimiters as part of the token. default - false

Parameters
includeDelims:boolean

if true add delimiters to the token

setSuppressDelimsback to summary
public void setSuppressDelims(boolean suppressDelims)

attribute suppressdelims - suppress delimiters. default - false

Parameters
suppressDelims:boolean

if true do not report delimiters