Class ParserUtils

  extended by

public class ParserUtils
extends Object

Utilities for parsing.


Method Summary
static Map<String,String> tokenize(String remainingBuffer)
          Converts a particular buffer into a tokenized structure.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static Map<String,String> tokenize(String remainingBuffer)
Converts a particular buffer into a tokenized structure.

Properly treats double quotes (") as option delimiters.

Expects option names to be preceded by a single or double dash. We call this an "option marker".

Treats spaces as the default option tokenizer.

Any token without an option marker is considered the default. The default is returned in the Map as an element with an empty string key (""). There can only be a single default.

remainingBuffer - to tokenize
a Map where keys are the option names (minus any dashes) and values are the option values (any double-quotes are removed)