This project has retired. For details please refer to its
        
        Attic page.
      
org.apache.wink.json4j
Class JSONStringer
java.lang.Object
   org.apache.wink.json4j.JSONWriter
org.apache.wink.json4j.JSONWriter
       org.apache.wink.json4j.JSONStringer
org.apache.wink.json4j.JSONStringer
- public class JSONStringer 
- extends JSONWriter
This class implements a JSONSringer, a basic convenience subclass of JSONWriter to allow for
 generating JSON strings quickly.   This class exists for API compatibility to other popular
 JSON parsers.
 
 
 
| Method Summary | 
|  void | close()Over-ride to do nothing for the stringer.
 | 
|  java.lang.String | toString()Return a string of the stringer contents.
 | 
 
| Methods inherited from class org.apache.wink.json4j.JSONWriter | 
| array, endArray, endObject, flush, key, object, value, value, value, value, value, value | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
 
JSONStringer
public JSONStringer()
toString
public java.lang.String toString()
- Return a string of the stringer contents.  This also terminates the
 Stringer and it cannot be used again.  If any errors occur while trying to generate the JSON
 it returns an empty string.
 
- 
- Overrides:
- toStringin class- java.lang.Object
 
- 
 
close
public void close()
           throws java.io.IOException,
                  java.lang.IllegalStateException
- Over-ride to do nothing for the stringer.  Only toString() terminates the stringer object.
 
- 
- Overrides:
- closein class- JSONWriter
 
- 
- Throws:
- java.io.IOException- Thrown if an IO error occurs on the underlying writer.
- java.lang.IllegalStateException- Thrown if the writer position is in an object and a key has been placed, but a value has not been assigned or if the writer was already closed.
 
Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.