org.mortbay.util
Class QuotedStringTokenizer
StringTokenizer
org.mortbay.util.QuotedStringTokenizer
public class QuotedStringTokenizer
extends StringTokenizer
StringTokenizer with Quoting support.
This class is a copy of the java.util.StringTokenizer API and
the behaviour is the same, except that single and doulbe quoted
string values are recognized.
Delimiters within quotes are not considered delimiters.
Quotes can be escaped with '\'.
$Id: QuotedStringTokenizer.java,v 1.4 2004/05/09 20:33:04 gregwilkins Exp $java.util.StringTokenizer
QuotedStringTokenizer
public QuotedStringTokenizer(String str)
QuotedStringTokenizer
public QuotedStringTokenizer(String str,
String delim)
QuotedStringTokenizer
public QuotedStringTokenizer(String str,
String delim,
boolean returnTokens)
QuotedStringTokenizer
public QuotedStringTokenizer(String str,
String delim,
boolean returnTokens,
boolean returnQuotes)
countTokens
public int countTokens()
Not implemented.
hasMoreElements
public boolean hasMoreElements()
hasMoreTokens
public boolean hasMoreTokens()
nextElement
public Object nextElement()
throws NoSuchElementException
nextToken
public String nextToken()
throws NoSuchElementException
nextToken
public String nextToken(String delim)
throws NoSuchElementException
quote
public static String quote(String s,
String delim)
Quote a string.
The string is quoted only if quoting is required due to
embeded delimiters, quote characters or the
empty string.
quote
public static void quote(StringBuffer buf,
String s)
Quote a string into a StringBuffer.
buf
- The StringBuffers
- The String to quote.
unquote
public static String unquote(String s)
Unquote a string.
s
- The string to unquote.
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.