public final class JsonWriter extends java.lang.Object implements ITagWriter
ITagWriter.Tag| Constructor and Description |
|---|
JsonWriter(java.io.OutputStream os) |
JsonWriter(java.io.OutputStream os,
boolean small) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
endTag()
Close the last open tag
|
void |
setAttributeOnNewLine(boolean attributeOnNewLine)
Size opti: don't write attribute on new line
|
void |
setAutoIndent(boolean indent)
Size opti: auto indent with tab
|
void |
setOptimizeValue(boolean optimizeValue)
Size opti: write value without "
|
void |
setTagOnNewLine(boolean tagOnNewLine)
Size opti: line break on a new tag/attributes
|
void |
writeTag(java.lang.Object tag) |
void |
writeTagAttribute(java.lang.Object attribute,
java.lang.String value)
Key/value atttribute
|
void |
writeTagContent(java.lang.String text)
This functionnality is deprecated as Json does not support it.
|
public JsonWriter(java.io.OutputStream os)
throws java.io.IOException
java.io.IOExceptionpublic JsonWriter(java.io.OutputStream os,
boolean small)
throws java.io.IOException
os - OutputStream to write json tosmall - true to use best optimization for smaller size, default false (similar to xml formating)java.io.IOExceptionpublic final void setTagOnNewLine(boolean tagOnNewLine)
public final void setAttributeOnNewLine(boolean attributeOnNewLine)
public final void setAutoIndent(boolean indent)
public final void setOptimizeValue(boolean optimizeValue)
public final void writeTag(java.lang.Object tag)
throws java.io.IOException
writeTag in interface ITagWritertag - write tag.toString()java.io.IOExceptionITagWriter.endTag()public final void writeTagAttribute(java.lang.Object attribute,
java.lang.String value)
throws java.io.IOException
ITagWriterwriteTagAttribute in interface ITagWriterattribute - write the attribute key attribute.toString()value - write the attribute valuejava.io.IOExceptionpublic void writeTagContent(java.lang.String text)
throws java.io.IOException
ITagWriterwriteTagContent in interface ITagWriterjava.io.IOExceptionpublic final void endTag()
throws java.io.IOException
ITagWriterendTag in interface ITagWriterjava.io.IOExceptionITagWriter.writeTag(Object)public final void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionBonzai Engine 1.3.4 11/12/2015 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2015 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com