org.springframework.shell.core
Class ParserUtils

java.lang.Object
  extended by org.springframework.shell.core.ParserUtils

public class ParserUtils
extends Object

Utilities for parsing.

Since:
1.0

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

tokenize

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.

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