public class GenericJsonSerializer
extends com.endeca.infront.util.serial.GenericSerializer
Modifier and Type | Class and Description |
---|---|
protected static class |
GenericJsonSerializer.PropertyCounter |
Modifier and Type | Field and Description |
---|---|
protected Stack<GenericJsonSerializer.PropertyCounter> |
itemStack |
Constructor and Description |
---|
GenericJsonSerializer(Writer writer)
Constructor.
|
GenericJsonSerializer(Writer writer,
int maxDepth)
Constructor.
|
GenericJsonSerializer(Writer pWriter,
int pMaxDepth,
boolean pDetectCycles)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeInternalNode() |
protected void |
closeItem()
Visit the end of an item.
|
protected void |
closeList()
Visit the end of a list.
|
protected void |
openElement(int elementCount)
Visit the start of a list element definition.
|
protected void |
openInternalNode() |
protected void |
openItem(Map<String,String> attributes)
Visit the start of an item.
|
protected void |
openList()
Visit the start of a list.
|
protected void |
openProperty(String name)
Visit the start of a property definition.
|
protected void |
visitBoolean(Boolean bool)
Visit a Boolean value.
|
protected void |
visitDouble(Double num)
Visit a double value.
|
protected void |
visitInteger(Integer num)
Visit an integer value.
|
protected void |
visitLong(Long num)
Visit an integer value.
|
protected void |
visitNull()
Visit a null value.
|
protected void |
visitString(String str)
Visit a string value.
|
protected void |
writeSeparator(int count) |
checkAndIncrementDepth, checkAndIncrementDepth, closeElement, closeProperty, decrementDepth, decrementDepth, handleArray, handleByteArray, handleDefault, handleEndecaNode, handleList, handleMap, overrideDepthCheck, serialize, traverseMap, write
protected Stack<GenericJsonSerializer.PropertyCounter> itemStack
public GenericJsonSerializer(Writer writer)
writer
- the character output streampublic GenericJsonSerializer(Writer writer, int maxDepth)
writer
- the character output streammaxDepth
- the maximum depth at which to serialize objects.public GenericJsonSerializer(Writer pWriter, int pMaxDepth, boolean pDetectCycles)
writer
- the character output streammaxDepth
- the maximum depth at which to serialize objects.detectCycles
- if true, throw an error when a cycle is found.protected void visitNull() throws IOException
com.endeca.infront.util.serial.GenericSerializer
visitNull
in class com.endeca.infront.util.serial.GenericSerializer
IOException
protected void visitString(String str) throws IOException
com.endeca.infront.util.serial.GenericSerializer
visitString
in class com.endeca.infront.util.serial.GenericSerializer
str
- the stringIOException
protected void visitInteger(Integer num) throws IOException
com.endeca.infront.util.serial.GenericSerializer
visitInteger
in class com.endeca.infront.util.serial.GenericSerializer
num
- the numberIOException
protected void visitDouble(Double num) throws IOException
com.endeca.infront.util.serial.GenericSerializer
visitDouble
in class com.endeca.infront.util.serial.GenericSerializer
num
- the numberIOException
protected void visitLong(Long num) throws IOException
com.endeca.infront.util.serial.GenericSerializer
visitLong
in class com.endeca.infront.util.serial.GenericSerializer
num
- the numberIOException
protected void visitBoolean(Boolean bool) throws IOException
com.endeca.infront.util.serial.GenericSerializer
visitBoolean
in class com.endeca.infront.util.serial.GenericSerializer
bool
- the booleanIOException
protected void openItem(Map<String,String> attributes) throws IOException
com.endeca.infront.util.serial.GenericSerializer
openItem
in class com.endeca.infront.util.serial.GenericSerializer
attributes
- an optional map of attribute name to attribute valueIOException
protected void closeItem() throws IOException
com.endeca.infront.util.serial.GenericSerializer
closeItem
in class com.endeca.infront.util.serial.GenericSerializer
IOException
protected void openProperty(String name) throws IOException
com.endeca.infront.util.serial.GenericSerializer
openProperty
in class com.endeca.infront.util.serial.GenericSerializer
name
- the name of the propertyIOException
protected void openElement(int elementCount) throws IOException
com.endeca.infront.util.serial.GenericSerializer
openElement
in class com.endeca.infront.util.serial.GenericSerializer
elementCount
- the number of elements that have precededIOException
protected void openInternalNode() throws IOException
openInternalNode
in class com.endeca.infront.util.serial.GenericSerializer
IOException
protected void closeInternalNode() throws IOException
closeInternalNode
in class com.endeca.infront.util.serial.GenericSerializer
IOException
protected void openList() throws IOException
com.endeca.infront.util.serial.GenericSerializer
openList
in class com.endeca.infront.util.serial.GenericSerializer
IOException
protected void closeList() throws IOException
com.endeca.infront.util.serial.GenericSerializer
closeList
in class com.endeca.infront.util.serial.GenericSerializer
IOException
protected void writeSeparator(int count) throws IOException
IOException
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.