/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * * @param input the string which is to be parsed * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(String input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * <p> * The input character array is not cloned, and must not be altered after * passing in to this method. * * @param input the string which is to be parsed, not cloned * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(char[] input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * * @param input the string which is to be parsed * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(String input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * * @param input the string which is to be parsed * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(String input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * * @param input the string which is to be parsed * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(String input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * * @param input the string which is to be parsed * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(String input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * * @param input the string which is to be parsed * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(String input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * <p> * The input character array is not cloned, and must not be altered after * passing in to this method. * * @param input the string which is to be parsed, not cloned * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(char[] input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * <p> * The input character array is not cloned, and must not be altered after * passing in to this method. * * @param input the string which is to be parsed, not cloned * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(char[] input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * <p> * The input character array is not cloned, and must not be altered after * passing in to this method. * * @param input the string which is to be parsed, not cloned * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(char[] input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * <p> * The input character array is not cloned, and must not be altered after * passing in to this method. * * @param input the string which is to be parsed, not cloned * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(char[] input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Constructs a tokenizer splitting on the specified delimiter character * and handling quotes using the specified quote character. * <p> * The input character array is not cloned, and must not be altered after * passing in to this method. * * @param input the string which is to be parsed, not cloned * @param delim the field delimiter character * @param quote the field quoted string character */ public StrTokenizer(char[] input, char delim, char quote) { this(input, delim); setQuoteChar(quote); }
/** * Transform an input string into a list of identifiers. * @param input A comma, new line, or tab delimited set of identifiers, * with optional double quoting. * @return A list of identifiers. */ public List<String> tokenise(String input) { List<String> ret = new LinkedList<String>(); StrTokenizer tokeniser = new StrTokenizer(input, charSetMatcher); tokeniser.setQuoteChar('"'); tokeniser.setIgnoreEmptyTokens(true); tokeniser.setTrimmerMatcher(StrMatcher.trimMatcher()); while (tokeniser.hasNext()) { String token = tokeniser.nextToken().trim(); ret.add(token); } return ret; } }
/** * Transform an input string into a list of identifiers. * @param input A comma, new line, or tab delimited set of identifiers, * with optional double quoting. * @return A list of identifiers. */ public List<String> tokenise(String input) { List<String> ret = new LinkedList<String>(); StrTokenizer tokeniser = new StrTokenizer(input, charSetMatcher); tokeniser.setQuoteChar('"'); tokeniser.setIgnoreEmptyTokens(true); tokeniser.setTrimmerMatcher(StrMatcher.trimMatcher()); while (tokeniser.hasNext()) { String token = tokeniser.nextToken().trim(); ret.add(token); } return ret; } }