Project Wonder 5.0

er.extensions.foundation
Class ERXCommandLineTokenizer

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

public class ERXCommandLineTokenizer
extends java.lang.Object
implements java.util.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(java.lang.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.
 java.lang.String nextElement()
          Returns the next token, or null if there is a parse error.
 java.lang.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(java.lang.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 java.util.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 java.lang.String nextElement()
Returns the next token, or null if there is a parse error.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
the next token

nextToken

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

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

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.