ERXCommandLineTokenizer Class Reference

Inherits java::util::Enumeration.

Collaboration diagram for ERXCommandLineTokenizer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ERXCommandLineTokenizer (String line)
boolean hasMoreElements ()
boolean hasMoreTokens ()
String nextElement ()
String nextToken () throws ParseException

Protected Member Functions

void reset ()

Private Types

enum  TokenizerState { Whitespace, Text, DoubleQuoted, SingleQuoted }

Private Attributes

StringCharacterIterator _iterator
TokenizerState _state
boolean _wasQuoted


Detailed Description

Tokenizes a string like a commandline parser, tokenizing on spaces unless the words are in double quotes or single quotes.

Author:
mschrag

Member Enumeration Documentation

enum TokenizerState [private]

Enumerator:
Whitespace 
Text 
DoubleQuoted 
SingleQuoted 


Constructor & Destructor Documentation

Creates a new ERXCommandLineTokenizer.

Parameters:
line the line to parse


Member Function Documentation

boolean hasMoreElements (  ) 

Returns true if there are more tokens on the line.

Returns:
true if there are more tokens on the line, false if not

boolean hasMoreTokens (  ) 

Returns true if there are more tokens on the line.

Returns:
true if there are more tokens on the line, false if not

String nextElement (  ) 

Returns the next token, or null if there is a parse error.

Returns:
the next token

String nextToken (  )  throws ParseException

Returns the next token.

Returns:
the next token
Exceptions:
ParseException if there is a parse failure
NoSuchElementException if there are no more tokens to parse

void reset (  )  [protected]


Member Data Documentation

StringCharacterIterator _iterator [private]

boolean _wasQuoted [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:12 2012 for Project Wonder by  doxygen 1.5.8