Package com.yahoo.slime
Class JsonFormat.Encoder
- java.lang.Object
-
- com.yahoo.slime.JsonFormat.Encoder
-
- All Implemented Interfaces:
ArrayTraverser
,ObjectTraverser
- Enclosing class:
- JsonFormat
public static final class JsonFormat.Encoder extends Object implements ArrayTraverser, ObjectTraverser
-
-
Constructor Summary
Constructors Constructor Description Encoder(Inspector value, AbstractByteWriter out, boolean compact)
Encoder(Inspector value, OutputStream out, boolean compact)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encode()
void
entry(int idx, Inspector inspector)
Callback function to implement.void
field(String name, Inspector inspector)
Callback function to implement.
-
-
-
Constructor Detail
-
Encoder
public Encoder(Inspector value, OutputStream out, boolean compact)
-
Encoder
public Encoder(Inspector value, AbstractByteWriter out, boolean compact)
-
-
Method Detail
-
encode
public void encode() throws IOException
- Throws:
IOException
-
entry
public void entry(int idx, Inspector inspector)
Description copied from interface:ArrayTraverser
Callback function to implement.- Specified by:
entry
in interfaceArrayTraverser
- Parameters:
idx
- array index for the current array entry.inspector
- accessor for the current array entry's value.
-
field
public void field(String name, Inspector inspector)
Description copied from interface:ObjectTraverser
Callback function to implement.- Specified by:
field
in interfaceObjectTraverser
- Parameters:
name
- symbol name for the current field.inspector
- accessor for the current field's value.
-
-