org.glassfish.jersey.message.internal
Class StringBuilderUtils

java.lang.Object
  extended by org.glassfish.jersey.message.internal.StringBuilderUtils

public class StringBuilderUtils
extends Object

Internal string builder utilities for building HTTP header values.

Author:
Marc Hadley, Marek Potociar (marek.potociar at oracle.com), Martin Matula (martin.matula at oracle.com)

Method Summary
static void appendEscapingQuotes(StringBuilder b, String value)
          Append a new value to the string builder.
static void appendQuoted(StringBuilder b, String value)
          Append a new quoted value to the string builder.
static void appendQuotedIfNonToken(StringBuilder b, String value)
          Append a new value to the string builder.
static void appendQuotedIfWhitespace(StringBuilder b, String value)
          Append a new value to the string builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

appendQuotedIfNonToken

public static void appendQuotedIfNonToken(StringBuilder b,
                                          String value)
Append a new value to the string builder. If the value contains non-token characters (e.g. control, white-space, quotes, separators, etc.), the appended value is quoted and all the quotes in the value are escaped.

Parameters:
b - string builder to be updated.
value - value to be appended.

appendQuotedIfWhitespace

public static void appendQuotedIfWhitespace(StringBuilder b,
                                            String value)
Append a new value to the string builder. If the value contains white-space characters, the appended value is quoted and all the quotes in the value are escaped.

Parameters:
b - string builder to be updated.
value - value to be appended.

appendQuoted

public static void appendQuoted(StringBuilder b,
                                String value)
Append a new quoted value to the string builder. The appended value is quoted and all the quotes in the value are escaped.

Parameters:
b - string builder to be updated.
value - value to be appended.

appendEscapingQuotes

public static void appendEscapingQuotes(StringBuilder b,
                                        String value)
Append a new value to the string builder. All the quotes in the value are escaped before appending.

Parameters:
b - string builder to be updated.
value - value to be appended.


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.