public class QuotedStringTokenizer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
QuotedStringTokenizer.Builder |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DELIMITERS |
static java.lang.String |
DEFAULT_QUOTE_CHARS |
Constructor and Description |
---|
QuotedStringTokenizer(java.lang.String stringToTokenize)
default quoted tokenizer, using single and double quotes as quote chars and returning quoted results
(use unquoteToken to unquote), and using whitespace chars as delimeters (not included as tokens);
string may be null if the nothing will be tokenized and the class is used only for
quoteToken(String) and unquote(String).
|
QuotedStringTokenizer(java.lang.String stringToTokenize,
boolean includeQuotes) |
QuotedStringTokenizer(java.lang.String stringToTokenize,
java.lang.String quoteChars,
boolean includeQuotes) |
QuotedStringTokenizer(java.lang.String stringToTokenize,
java.lang.String quoteChars,
boolean includeQuotes,
java.lang.String delimiters,
boolean includeDelimiters) |
Modifier and Type | Method and Description |
---|---|
static QuotedStringTokenizer.Builder |
builder() |
boolean |
hasMoreTokens() |
static boolean |
hasOpenQuote(java.lang.String stringToCheck) |
static boolean |
hasOpenQuote(java.lang.String stringToCheck,
java.lang.String quoteChars) |
java.lang.String |
nextToken() |
java.lang.String |
quoteToken(java.lang.String unescapedText)
returns the input text escaped for use with unquoteTokens, and wrapped in the quoteChar[0] (usu a double quote)
|
java.util.List<java.lang.String> |
remainderAsList() |
java.lang.String |
unquoteToken(java.lang.String word)
this method removes all unescaped quote chars, i.e.
|
public static java.lang.String DEFAULT_QUOTE_CHARS
public static final java.lang.String DEFAULT_DELIMITERS
public QuotedStringTokenizer(java.lang.String stringToTokenize)
public QuotedStringTokenizer(java.lang.String stringToTokenize, boolean includeQuotes)
public QuotedStringTokenizer(java.lang.String stringToTokenize, java.lang.String quoteChars, boolean includeQuotes)
public QuotedStringTokenizer(java.lang.String stringToTokenize, java.lang.String quoteChars, boolean includeQuotes, java.lang.String delimiters, boolean includeDelimiters)
public static QuotedStringTokenizer.Builder builder()
public boolean hasMoreTokens()
public java.lang.String nextToken()
public java.lang.String unquoteToken(java.lang.String word)
public java.lang.String quoteToken(java.lang.String unescapedText)
public static boolean hasOpenQuote(java.lang.String stringToCheck)
public static boolean hasOpenQuote(java.lang.String stringToCheck, java.lang.String quoteChars)
public java.util.List<java.lang.String> remainderAsList()