com.novell.sentinel.json.java
Class JSONSerializer

java.lang.Object
  extended by com.novell.sentinel.json.JSONSerializerBase
      extended by com.novell.sentinel.json.java.JSONSerializer
All Implemented Interfaces:
JSONHandler

public class JSONSerializer
extends JSONSerializerBase

Implementation of JSONHandler to serialize a series of JSON "events" to a java.io.Writer.


Constructor Summary
JSONSerializer()
          Default constructor.
JSONSerializer(Writer _writer)
          Constructor which sets the Writer to use for output.
 
Method Summary
 Writer getWriter()
           
 void setWriter(Writer _writer)
          Set the Writer to use for output.
protected  void write(char value)
          Output the passed char to whatever destination the derived class specifies.
protected  void write(String value)
          Output the passed string to whatever destination the derived class specifies.
 
Methods inherited from class com.novell.sentinel.json.JSONSerializerBase
booleanValue, endArray, endObject, name, nullValue, numberValue, setIndent, startArray, startObject, stringValue, willIndent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONSerializer

public JSONSerializer()
Default constructor. The setWriter(java.io.Writer) method must be called before any JSON events are issued to the resulting instance.


JSONSerializer

public JSONSerializer(Writer _writer)
Constructor which sets the Writer to use for output.

Parameters:
_writer - The Writer.
Method Detail

setWriter

public void setWriter(Writer _writer)
Set the Writer to use for output.

Parameters:
_writer - The Writer.

getWriter

public Writer getWriter()
Returns:
The Writer being used for output.

write

protected void write(String value)
              throws IOException
Description copied from class: JSONSerializerBase
Output the passed string to whatever destination the derived class specifies.

Specified by:
write in class JSONSerializerBase
Parameters:
value - The value to write.
Throws:
IOException - If an error occurs while writing.

write

protected void write(char value)
              throws IOException
Description copied from class: JSONSerializerBase
Output the passed char to whatever destination the derived class specifies.

Specified by:
write in class JSONSerializerBase
Parameters:
value - The value to write.
Throws:
IOException - If an error occurs while writing.