com.badlogic.gdx.utils
Class JsonWriter
java.lang.Object
java.io.Writer
com.badlogic.gdx.utils.JsonWriter
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.Appendable
public class JsonWriter
- extends java.io.Writer
Builder style API for emitting JSON.
- Author:
- Nathan Sweet
Fields inherited from class java.io.Writer |
lock |
Constructor Summary |
JsonWriter(java.io.Writer writer)
|
Methods inherited from class java.io.Writer |
append, append, append, write, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsonWriter
public JsonWriter(java.io.Writer writer)
setOutputType
public void setOutputType(JsonWriter.OutputType outputType)
name
public JsonWriter name(java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
object
public JsonWriter object()
throws java.io.IOException
- Throws:
java.io.IOException
array
public JsonWriter array()
throws java.io.IOException
- Throws:
java.io.IOException
value
public JsonWriter value(java.lang.Object value)
throws java.io.IOException
- Throws:
java.io.IOException
object
public JsonWriter object(java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
array
public JsonWriter array(java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
set
public JsonWriter set(java.lang.String name,
java.lang.Object value)
throws java.io.IOException
- Throws:
java.io.IOException
pop
public JsonWriter pop()
throws java.io.IOException
- Throws:
java.io.IOException
write
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Specified by:
write
in class java.io.Writer
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Specified by:
flush
in interface java.io.Flushable
- Specified by:
flush
in class java.io.Writer
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Specified by:
close
in class java.io.Writer
- Throws:
java.io.IOException
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)