org.apache.camel.util
Class StringQuoteHelper

java.lang.Object
  extended by org.apache.camel.util.StringQuoteHelper

public final class StringQuoteHelper
extends Object

Utility class for parsing quoted string which is intended for parameters, separated by comma.


Method Summary
static String[] splitSafeQuote(String input, char separator)
          Splits the input safely honoring if values is enclosed in quotes.
static String[] splitSafeQuote(String input, char separator, boolean trim)
          Splits the input safely honoring if values is enclosed in quotes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

splitSafeQuote

public static String[] splitSafeQuote(String input,
                                      char separator)
Splits the input safely honoring if values is enclosed in quotes.

Though this method does not support double quoting values. A quoted value must start with the same start and ending quote, which is either a single quote or double quote value.

Will trim each splitted value by default.

Parameters:
input - the input
separator - the separator char to split the input, for example a comma.
Returns:
the input splitted, or null if the input is null.

splitSafeQuote

public static String[] splitSafeQuote(String input,
                                      char separator,
                                      boolean trim)
Splits the input safely honoring if values is enclosed in quotes.

Though this method does not support double quoting values. A quoted value must start with the same start and ending quote, which is either a single quote or double quote value. \

Parameters:
input - the input
separator - the separator char to split the input, for example a comma.
trim - whether to trim each splitted value
Returns:
the input splitted, or null if the input is null.


Apache CAMEL