public synchronized String nextToken() { if (peekedNextToken==null) throw new NoSuchElementException(); String lastToken = peekedNextToken; updateNextToken(); return includeQuotes ? lastToken : unquoteToken(lastToken); }
String unquotedKey = tokenizer.unquoteToken(token); result.put(unquotedKey, null); String unquotedKey = tokenizer.unquoteToken(token.substring(0, index).trim()); String unquotedVal = tokenizer.unquoteToken(token.substring(index+1).trim()); result.put(unquotedKey, unquotedVal); String unquotedKey = tokenizer.unquoteToken(token.substring(0, index).trim()); result.put(unquotedKey, "");
private void assertUnquoteFor(String expected, String quoted) { String unquoted = defaultTokenizer.unquoteToken(quoted); //System.out.println("expected="+expected+" quoted="+quoted+" unquoted="+unquoted); assertEquals(unquoted, expected); } }
public static List<String> parseList(String line) { List<String> result = new ArrayList<String>(); QuotedStringTokenizer tokenizer = new QuotedStringTokenizer(line, null, true, ",", false); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.unquoteToken(tokenizer.nextToken().trim())); } return result; }
private void assertQuoteUnquoteFor(String unquoted) { String quoted = defaultTokenizer.quoteToken(unquoted); String reunquoted = defaultTokenizer.unquoteToken(quoted); //System.out.println("orig="+unquoted+" quoted="+quoted+" reunquoted="+reunquoted); assertEquals(reunquoted, unquoted); }