com.ibm.commons.util.io.json
Class JsonGenerator.Generator

java.lang.Object
  extended by com.ibm.commons.util.io.json.JsonGenerator.Generator
Direct Known Subclasses:
JsonGenerator.StringBuilderGenerator, JsonGenerator.StringGenerator, JsonGenerator.WriterGenerator
Enclosing class:
JsonGenerator

public abstract static class JsonGenerator.Generator
extends java.lang.Object

Generator base class.


Constructor Summary
protected JsonGenerator.Generator(JsonFactory factory, boolean compact)
           
 
Method Summary
 void decIndent()
           
protected  void endObject(java.lang.Object object)
           
 JsonFactory getFactory()
           
 int getIndentLevel()
           
 void incIndent()
           
 void indent()
           
 boolean isCompact()
           
 void nl()
           
abstract  void out(char c)
           
abstract  void out(java.lang.String s)
           
 void outArrayLiteral(java.lang.Object array)
           
protected  void outArrayLiteral(java.lang.Object array, boolean named)
          Writes an array property.
 void outBooleanLiteral(boolean b)
           
 void outCharInString(char c)
           
 void outDateLiteral_(java.util.Date value)
           
 void outIntLiteral(int d)
           
 void outLiteral(java.lang.Object value)
           
protected  void outLiteral(java.lang.Object value, boolean named)
          Writes a property value.
 void outLongLiteral(long d)
           
 void outNull()
           
 void outNumberLiteral(double d)
           
 void outObject(java.lang.Object object)
           
protected  void outObject(java.lang.Object object, boolean named)
          Writes a JSON object property.
 void outPropertyName(java.lang.String s)
           
 void outReference(JsonReference ref)
           
 void outStringLiteral(java.lang.String s)
           
 void setIndentLevel(int indentLevel)
           
protected  void startObject(java.lang.Object object)
           
 void toJson(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonGenerator.Generator

protected JsonGenerator.Generator(JsonFactory factory,
                                  boolean compact)
Method Detail

out

public abstract void out(char c)
                  throws java.io.IOException
Throws:
java.io.IOException

out

public abstract void out(java.lang.String s)
                  throws java.io.IOException
Throws:
java.io.IOException

getFactory

public JsonFactory getFactory()

getIndentLevel

public int getIndentLevel()

setIndentLevel

public void setIndentLevel(int indentLevel)

incIndent

public void incIndent()

decIndent

public void decIndent()

isCompact

public boolean isCompact()

toJson

public void toJson(java.lang.Object value)
            throws java.io.IOException,
                   JsonException
Throws:
java.io.IOException
JsonException

outLiteral

public void outLiteral(java.lang.Object value)
                throws java.io.IOException,
                       JsonException
Throws:
java.io.IOException
JsonException

outLiteral

protected void outLiteral(java.lang.Object value,
                          boolean named)
                   throws java.io.IOException,
                          JsonException
Writes a property value.

Parameters:
value - The value to write.
named - true if the property is named.
Throws:
java.io.IOException
JsonException

outNull

public void outNull()
             throws java.io.IOException,
                    JsonException
Throws:
java.io.IOException
JsonException

outObject

public void outObject(java.lang.Object object)
               throws java.io.IOException,
                      JsonException
Throws:
java.io.IOException
JsonException

outObject

protected void outObject(java.lang.Object object,
                         boolean named)
                  throws java.io.IOException,
                         JsonException
Writes a JSON object property.

Parameters:
object - The object to write.
named - true if the object is named.
Throws:
java.io.IOException
JsonException

startObject

protected void startObject(java.lang.Object object)
                    throws java.io.IOException,
                           JsonException
Throws:
java.io.IOException
JsonException

endObject

protected void endObject(java.lang.Object object)
                  throws java.io.IOException,
                         JsonException
Throws:
java.io.IOException
JsonException

outPropertyName

public void outPropertyName(java.lang.String s)
                     throws java.io.IOException
Throws:
java.io.IOException

outStringLiteral

public void outStringLiteral(java.lang.String s)
                      throws java.io.IOException
Throws:
java.io.IOException

outCharInString

public void outCharInString(char c)
                     throws java.io.IOException
Throws:
java.io.IOException

outNumberLiteral

public void outNumberLiteral(double d)
                      throws java.io.IOException
Throws:
java.io.IOException

outDateLiteral_

public void outDateLiteral_(java.util.Date value)
                     throws java.io.IOException
Throws:
java.io.IOException

outIntLiteral

public void outIntLiteral(int d)
                   throws java.io.IOException
Throws:
java.io.IOException

outLongLiteral

public void outLongLiteral(long d)
                    throws java.io.IOException
Throws:
java.io.IOException

outBooleanLiteral

public void outBooleanLiteral(boolean b)
                       throws java.io.IOException
Throws:
java.io.IOException

outArrayLiteral

public void outArrayLiteral(java.lang.Object array)
                     throws java.io.IOException,
                            JsonException
Throws:
java.io.IOException
JsonException

outArrayLiteral

protected void outArrayLiteral(java.lang.Object array,
                               boolean named)
                        throws java.io.IOException,
                               JsonException
Writes an array property.

Parameters:
array - The array to write.
named - true if the property is named.
Throws:
java.io.IOException
JsonException

outReference

public void outReference(JsonReference ref)
                  throws java.io.IOException,
                         JsonException
Throws:
java.io.IOException
JsonException

indent

public void indent()
            throws java.io.IOException
Throws:
java.io.IOException

nl

public void nl()
        throws java.io.IOException
Throws:
java.io.IOException