|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.StringTokenizer org.mortbay.util.QuotedStringTokenizer
public class QuotedStringTokenizer
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 '\'.
StringTokenizer
Field Summary | |
---|---|
private static String |
__delim
|
private String |
_delim
|
private boolean |
_hasToken
|
private int |
_i
|
private int |
_lastStart
|
private boolean |
_returnDelimiters
|
private boolean |
_returnQuotes
|
private String |
_string
|
private StringBuffer |
_token
|
Constructor Summary | |
---|---|
QuotedStringTokenizer(String str)
|
|
QuotedStringTokenizer(String str,
String delim)
|
|
QuotedStringTokenizer(String str,
String delim,
boolean returnDelimiters)
|
|
QuotedStringTokenizer(String str,
String delim,
boolean returnDelimiters,
boolean returnQuotes)
|
Method Summary | |
---|---|
int |
countTokens()
Not implemented. |
boolean |
hasMoreElements()
|
boolean |
hasMoreTokens()
|
Object |
nextElement()
|
String |
nextToken()
|
String |
nextToken(String delim)
|
static void |
quote(StringBuffer buf,
String s)
Quote a string into a StringBuffer. |
static String |
quote(String s,
String delim)
Quote a string. |
static String |
unquote(String s)
Unquote a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String __delim
private String _string
private String _delim
private boolean _returnQuotes
private boolean _returnDelimiters
private StringBuffer _token
private boolean _hasToken
private int _i
private int _lastStart
Constructor Detail |
---|
public QuotedStringTokenizer(String str, String delim, boolean returnDelimiters, boolean returnQuotes)
public QuotedStringTokenizer(String str, String delim, boolean returnDelimiters)
public QuotedStringTokenizer(String str, String delim)
public QuotedStringTokenizer(String str)
Method Detail |
---|
public boolean hasMoreTokens()
hasMoreTokens
in class StringTokenizer
public String nextToken() throws NoSuchElementException
nextToken
in class StringTokenizer
NoSuchElementException
public String nextToken(String delim) throws NoSuchElementException
nextToken
in class StringTokenizer
NoSuchElementException
public boolean hasMoreElements()
hasMoreElements
in interface Enumeration<Object>
hasMoreElements
in class StringTokenizer
public Object nextElement() throws NoSuchElementException
nextElement
in interface Enumeration<Object>
nextElement
in class StringTokenizer
NoSuchElementException
public int countTokens()
countTokens
in class StringTokenizer
public static String quote(String s, String delim)
s
- The string to quote.
public static void quote(StringBuffer buf, String s)
buf
- The StringBuffers
- The String to quote.public static String unquote(String s)
s
- The string to unquote.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |