org.apache.jackrabbit.mk.json
Class JsonBuilder

java.lang.Object
  extended by org.apache.jackrabbit.mk.json.JsonBuilder

public final class JsonBuilder
extends Object

Partially based on json-simple Limitation: arrays can only have primitive members (i.e. no arrays nor objects)


Nested Class Summary
 class JsonBuilder.JsonArrayBuilder
           
 class JsonBuilder.JsonObjectBuilder
           
 
Method Summary
static JsonBuilder.JsonObjectBuilder create(Appendable writer)
           
static String encode(boolean value)
           
static String encode(boolean[] values)
           
static String encode(double value)
           
static String encode(double[] values)
           
static String encode(float value)
           
static String encode(float[] values)
           
static String encode(int value)
           
static String encode(int[] values)
           
static String encode(long value)
           
static String encode(long[] values)
           
static String encode(Number value)
           
static String encode(Number[] values)
           
static String encode(String value)
           
static String encode(String[] values)
           
static String escape(String string)
          Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
static String quote(String string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static JsonBuilder.JsonObjectBuilder create(Appendable writer)
                                            throws IOException
Throws:
IOException

escape

public static String escape(String string)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).


quote

public static String quote(String string)

encode

public static String encode(String value)

encode

public static String encode(int value)

encode

public static String encode(long value)

encode

public static String encode(float value)

encode

public static String encode(double value)

encode

public static String encode(Number value)

encode

public static String encode(boolean value)

encode

public static String encode(String[] values)

encode

public static String encode(int[] values)

encode

public static String encode(long[] values)

encode

public static String encode(float[] values)

encode

public static String encode(double[] values)

encode

public static String encode(Number[] values)

encode

public static String encode(boolean[] values)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.