Project Wonder 5.0.0.8795

er.extensions.foundation
Class ERXCommandLineTokenizer

java.lang.Object
  extended by er.extensions.foundation.ERXCommandLineTokenizer
All Implemented Interfaces:
Enumeration

public class ERXCommandLineTokenizer
extends Object
implements Enumeration

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

Author:
mschrag

Constructor Summary
ERXCommandLineTokenizer(String line)
          Creates a new ERXCommandLineTokenizer.
 
Method Summary
 boolean hasMoreElements()
          Returns true if there are more tokens on the line.
 boolean hasMoreTokens()
          Returns true if there are more tokens on the line.
 String nextElement()
          Returns the next token, or null if there is a parse error.
 String nextToken()
          Returns the next token.
protected  void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXCommandLineTokenizer

public ERXCommandLineTokenizer(String line)
Creates a new ERXCommandLineTokenizer.

Parameters:
line - the line to parse
Method Detail

reset

protected void reset()

hasMoreElements

public boolean hasMoreElements()
Returns true if there are more tokens on the line.

Specified by:
hasMoreElements in interface Enumeration
Returns:
true if there are more tokens on the line, false if not

hasMoreTokens

public 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

nextElement

public String nextElement()
Returns the next token, or null if there is a parse error.

Specified by:
nextElement in interface Enumeration
Returns:
the next token

nextToken

public String nextToken()
                 throws ParseException
Returns the next token.

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

Last updated: Fri, Jan 9, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.