Package org.noggit
Class JSONWriter
- java.lang.Object
-
- org.noggit.JSONWriter
-
public class JSONWriter extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
JSONWriter.Writable
Implement this interface on your class to support serialization
-
Constructor Summary
Constructors Constructor Description JSONWriter(CharArr out)
JSONWriter(CharArr out, int indentSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endArray()
void
endObject()
void
handleUnknownClass(Object o)
Override this method for custom handling of unknown classes.void
indent()
void
setIndentSize(int indentSize)
void
startArray()
void
startObject()
void
write(boolean bool)
void
write(boolean[] val)
void
write(byte number)
void
write(byte[] val)
A byte[] may be either a single logical value, or a list of small integers.void
write(char[] val)
void
write(double number)
void
write(double[] val)
void
write(float number)
void
write(float[] val)
void
write(int number)
void
write(int[] val)
void
write(long number)
void
write(long[] val)
void
write(short number)
void
write(short[] val)
void
write(Object o)
void
write(Collection<?> val)
void
write(Map<?,?> val)
void
writeNameSeparator()
void
writeNull()
void
writeNumber(CharArr digits)
void
writePartialNumber(CharArr digits)
void
writeString(CharSequence str)
void
writeString(String str)
void
writeString(CharArr str)
void
writeStringChars(CharArr partialStr)
void
writeStringEnd()
void
writeStringStart()
void
writeValueSeparator()
-
-
-
Field Detail
-
level
protected int level
-
indent
protected int indent
-
out
protected final CharArr out
-
-
Method Detail
-
setIndentSize
public void setIndentSize(int indentSize)
-
indent
public void indent()
-
write
public void write(Object o)
-
handleUnknownClass
public void handleUnknownClass(Object o)
Override this method for custom handling of unknown classes. Also see the Writable interface.
-
write
public void write(Map<?,?> val)
-
write
public void write(Collection<?> val)
-
write
public void write(byte[] val)
A byte[] may be either a single logical value, or a list of small integers. It's up to the implementation to decide.
-
write
public void write(short[] val)
-
write
public void write(int[] val)
-
write
public void write(long[] val)
-
write
public void write(float[] val)
-
write
public void write(double[] val)
-
write
public void write(boolean[] val)
-
write
public void write(short number)
-
write
public void write(byte number)
-
writeNull
public void writeNull()
-
writeString
public void writeString(String str)
-
writeString
public void writeString(CharSequence str)
-
writeString
public void writeString(CharArr str)
-
writeStringStart
public void writeStringStart()
-
writeStringChars
public void writeStringChars(CharArr partialStr)
-
writeStringEnd
public void writeStringEnd()
-
write
public void write(long number)
-
write
public void write(int number)
-
write
public void write(double number)
-
write
public void write(float number)
-
write
public void write(boolean bool)
-
write
public void write(char[] val)
-
writeNumber
public void writeNumber(CharArr digits)
-
writePartialNumber
public void writePartialNumber(CharArr digits)
-
startObject
public void startObject()
-
endObject
public void endObject()
-
startArray
public void startArray()
-
endArray
public void endArray()
-
writeValueSeparator
public void writeValueSeparator()
-
writeNameSeparator
public void writeNameSeparator()
-
-