|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dyuproject.protostuff.JsonOutput
public final class JsonOutput
An output used for writing data with json format.
| Constructor Summary | |
|---|---|
JsonOutput(org.codehaus.jackson.JsonGenerator generator)
|
|
JsonOutput(org.codehaus.jackson.JsonGenerator generator,
boolean numeric)
|
|
JsonOutput(org.codehaus.jackson.JsonGenerator generator,
boolean numeric,
Schema<?> schema)
|
|
| Method Summary | ||
|---|---|---|
int |
getLastNumber()
Gets the last field number written. |
|
boolean |
isLastRepeated()
Returns true if the last written field was a repeated field. |
|
boolean |
isNumeric()
Returns whether the incoming messages' field names are numeric. |
|
JsonOutput |
reset()
Resets this output for re-use. |
|
void |
updateLast(Schema<?> schema,
Schema<?> lastSchema)
|
|
JsonOutput |
use(Schema<?> schema)
Before serializing a message/object tied to a schema, this should be called. |
|
void |
writeBool(int fieldNumber,
boolean value,
boolean repeated)
|
|
void |
writeByteArray(int fieldNumber,
byte[] value,
boolean repeated)
|
|
void |
writeByteRange(boolean utf8String,
int fieldNumber,
byte[] value,
int offset,
int length,
boolean repeated)
|
|
void |
writeBytes(int fieldNumber,
ByteString value,
boolean repeated)
|
|
void |
writeDouble(int fieldNumber,
double value,
boolean repeated)
|
|
void |
writeEnum(int fieldNumber,
int value,
boolean repeated)
|
|
void |
writeFixed32(int fieldNumber,
int value,
boolean repeated)
|
|
void |
writeFixed64(int fieldNumber,
long value,
boolean repeated)
|
|
void |
writeFloat(int fieldNumber,
float value,
boolean repeated)
|
|
void |
writeInt32(int fieldNumber,
int value,
boolean repeated)
|
|
void |
writeInt64(int fieldNumber,
long value,
boolean repeated)
|
|
|
writeObject(int fieldNumber,
T value,
Schema<T> schema,
boolean repeated)
|
|
void |
writeSFixed32(int fieldNumber,
int value,
boolean repeated)
|
|
void |
writeSFixed64(int fieldNumber,
long value,
boolean repeated)
|
|
void |
writeSInt32(int fieldNumber,
int value,
boolean repeated)
|
|
void |
writeSInt64(int fieldNumber,
long value,
boolean repeated)
|
|
void |
writeString(int fieldNumber,
java.lang.String value,
boolean repeated)
|
|
void |
writeUInt32(int fieldNumber,
int value,
boolean repeated)
|
|
void |
writeUInt64(int fieldNumber,
long value,
boolean repeated)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonOutput(org.codehaus.jackson.JsonGenerator generator)
public JsonOutput(org.codehaus.jackson.JsonGenerator generator,
boolean numeric)
public JsonOutput(org.codehaus.jackson.JsonGenerator generator,
boolean numeric,
Schema<?> schema)
| Method Detail |
|---|
public JsonOutput reset()
public JsonOutput use(Schema<?> schema)
public boolean isNumeric()
public int getLastNumber()
public boolean isLastRepeated()
public void updateLast(Schema<?> schema,
Schema<?> lastSchema)
updateLast in interface StatefulOutput
public void writeBool(int fieldNumber,
boolean value,
boolean repeated)
throws java.io.IOException
writeBool in interface Outputjava.io.IOException
public void writeByteArray(int fieldNumber,
byte[] value,
boolean repeated)
throws java.io.IOException
writeByteArray in interface Outputjava.io.IOException
public void writeByteRange(boolean utf8String,
int fieldNumber,
byte[] value,
int offset,
int length,
boolean repeated)
throws java.io.IOException
writeByteRange in interface Outputjava.io.IOException
public void writeBytes(int fieldNumber,
ByteString value,
boolean repeated)
throws java.io.IOException
writeBytes in interface Outputjava.io.IOException
public void writeDouble(int fieldNumber,
double value,
boolean repeated)
throws java.io.IOException
writeDouble in interface Outputjava.io.IOException
public void writeEnum(int fieldNumber,
int value,
boolean repeated)
throws java.io.IOException
writeEnum in interface Outputjava.io.IOException
public void writeFixed32(int fieldNumber,
int value,
boolean repeated)
throws java.io.IOException
writeFixed32 in interface Outputjava.io.IOException
public void writeFixed64(int fieldNumber,
long value,
boolean repeated)
throws java.io.IOException
writeFixed64 in interface Outputjava.io.IOException
public void writeFloat(int fieldNumber,
float value,
boolean repeated)
throws java.io.IOException
writeFloat in interface Outputjava.io.IOException
public void writeInt32(int fieldNumber,
int value,
boolean repeated)
throws java.io.IOException
writeInt32 in interface Outputjava.io.IOException
public void writeInt64(int fieldNumber,
long value,
boolean repeated)
throws java.io.IOException
writeInt64 in interface Outputjava.io.IOException
public void writeSFixed32(int fieldNumber,
int value,
boolean repeated)
throws java.io.IOException
writeSFixed32 in interface Outputjava.io.IOException
public void writeSFixed64(int fieldNumber,
long value,
boolean repeated)
throws java.io.IOException
writeSFixed64 in interface Outputjava.io.IOException
public void writeSInt32(int fieldNumber,
int value,
boolean repeated)
throws java.io.IOException
writeSInt32 in interface Outputjava.io.IOException
public void writeSInt64(int fieldNumber,
long value,
boolean repeated)
throws java.io.IOException
writeSInt64 in interface Outputjava.io.IOException
public void writeString(int fieldNumber,
java.lang.String value,
boolean repeated)
throws java.io.IOException
writeString in interface Outputjava.io.IOException
public void writeUInt32(int fieldNumber,
int value,
boolean repeated)
throws java.io.IOException
writeUInt32 in interface Outputjava.io.IOException
public void writeUInt64(int fieldNumber,
long value,
boolean repeated)
throws java.io.IOException
writeUInt64 in interface Outputjava.io.IOException
public <T> void writeObject(int fieldNumber,
T value,
Schema<T> schema,
boolean repeated)
throws java.io.IOException
writeObject in interface Outputjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||