* @param line
* @return
*/
public Map<String, String> parseLine(String line) {
if (line == null) {
throw new LTSVParseException("line must not be null.");
}
StringTokenizer tokenizer = new StringTokenizer(chomp(line), LTSV.TAB);
Map<String, String> result = mapFactory.createMap();
while (tokenizer.hasMoreTokens()) {
String labeledField = tokenizer.nextToken();
String[] values = SEPARATOR_PATTERN.split(labeledField, 2);
if (values.length != 2) {
throw new LTSVParseException("label and field (" + labeledField
+ ") are not separated by " + LTSV.SEPARATOR);
}
String label = values[0];
String field = values[1];