|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.shyiko.mysql.binlog.event.deserialization.json.JsonStringFormatter
public class JsonStringFormatter
A JsonFormatter implementation that creates a JSON string representation.
| Constructor Summary | |
|---|---|
JsonStringFormatter()
|
|
| Method Summary | |
|---|---|
protected void |
appendDate(int year,
int month,
int day)
|
protected void |
appendFourDigitUnsignedInt(int value)
|
protected void |
appendSixDigitUnsignedInt(int value,
boolean trimTrailingZeros)
|
protected void |
appendString(String original)
Append a string by escaping any characters that must be escaped. |
protected void |
appendTime(int hour,
int min,
int sec,
int microSeconds)
|
protected void |
appendTwoDigitUnsignedInt(int value)
|
void |
beginArray(int numElements)
Prepare to receive the value pairs that in a JSON array. |
void |
beginObject(int numElements)
Prepare to receive the name-value pairs in a JSON object. |
void |
endArray()
Complete the previously-started JSON array. |
void |
endObject()
Complete the previously-started JSON object. |
String |
getString()
|
void |
name(String name)
Receive the name of an element in a JSON object. |
void |
nextEntry()
Called after an entry signaling that another entry will be signaled. |
String |
toString()
|
void |
value(BigDecimal value)
Receive the BigDecimal value of an element in a JSON object. |
void |
value(BigInteger value)
Receive the BigInteger value of an element in a JSON object. |
void |
value(boolean value)
Receive the boolean value of an element in a JSON object. |
void |
value(double value)
Receive the double value of an element in a JSON object. |
void |
value(int value)
Receive the integer value of an element in a JSON object. |
void |
value(long value)
Receive the long value of an element in a JSON object. |
void |
value(String value)
Receive the string value of an element in a JSON object. |
void |
valueDate(int year,
int month,
int day)
Receive the date value of an element in a JSON object. |
void |
valueDatetime(int year,
int month,
int day,
int hour,
int min,
int sec,
int microSeconds)
Receive the date and time value of an element in a JSON object. |
void |
valueNull()
Receive a null value of an element in a JSON object. |
void |
valueOpaque(ColumnType type,
byte[] value)
Receive an opaque value of an element in a JSON object. |
void |
valueTime(int hour,
int min,
int sec,
int microSeconds)
Receive the time value of an element in a JSON object. |
void |
valueTimestamp(long secondsPastEpoch,
int microSeconds)
Receive the timestamp value of an element in a JSON object. |
void |
valueYear(int year)
Receive the year value of an element in a JSON object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JsonStringFormatter()
| Method Detail |
|---|
public String toString()
toString in class Objectpublic String getString()
public void beginObject(int numElements)
JsonFormatter
beginObject in interface JsonFormatternumElements - the number of name-value pairs (or elements)public void beginArray(int numElements)
JsonFormatter
beginArray in interface JsonFormatternumElements - the number of array elementspublic void endObject()
JsonFormatter
endObject in interface JsonFormatterpublic void endArray()
JsonFormatter
endArray in interface JsonFormatterpublic void name(String name)
JsonFormatter
name in interface JsonFormattername - the element's name; never nullpublic void value(String value)
JsonFormatter
value in interface JsonFormattervalue - the element's value; never nullpublic void value(int value)
JsonFormatter
value in interface JsonFormattervalue - the element's valuepublic void value(long value)
JsonFormatter
value in interface JsonFormattervalue - the element's valuepublic void value(double value)
JsonFormatter
value in interface JsonFormattervalue - the element's valuepublic void value(BigInteger value)
JsonFormatterBigInteger value of an element in a JSON object.
value in interface JsonFormattervalue - the element's value; never nullpublic void value(BigDecimal value)
JsonFormatterBigDecimal value of an element in a JSON object.
value in interface JsonFormattervalue - the element's value; never nullpublic void value(boolean value)
JsonFormatter
value in interface JsonFormattervalue - the element's valuepublic void valueNull()
JsonFormatter
valueNull in interface JsonFormatterpublic void valueYear(int year)
JsonFormatter
valueYear in interface JsonFormatteryear - the year number that makes up the element's value
public void valueDate(int year,
int month,
int day)
JsonFormatter
valueDate in interface JsonFormatteryear - the positive or negative year in the element's date valuemonth - the month (0-12) in the element's date valueday - the day of the month (0-31) in the element's date value
public void valueDatetime(int year,
int month,
int day,
int hour,
int min,
int sec,
int microSeconds)
JsonFormatter
valueDatetime in interface JsonFormatteryear - the positive or negative year in the element's date valuemonth - the month (0-12) in the element's date valueday - the day of the month (0-31) in the element's date valuehour - the hour of the day (0-24) in the element's time valuemin - the minutes of the hour (0-60) in the element's time valuesec - the seconds of the minute (0-60) in the element's time valuemicroSeconds - the number of microseconds in the element's time value
public void valueTime(int hour,
int min,
int sec,
int microSeconds)
JsonFormatter
valueTime in interface JsonFormatterhour - the hour of the day (0-24) in the element's time valuemin - the minutes of the hour (0-60) in the element's time valuesec - the seconds of the minute (0-60) in the element's time valuemicroSeconds - the number of microseconds in the element's time value
public void valueTimestamp(long secondsPastEpoch,
int microSeconds)
JsonFormatter
valueTimestamp in interface JsonFormattersecondsPastEpoch - the number of seconds past epoch (January 1, 1970) in the element's timestamp valuemicroSeconds - the number of microseconds in the element's time value
public void valueOpaque(ColumnType type,
byte[] value)
JsonFormatter
valueOpaque in interface JsonFormattertype - the column type for the value; may not be nullvalue - the binary representation for the element's valuepublic void nextEntry()
JsonFormatter
nextEntry in interface JsonFormatterprotected void appendString(String original)
original - the string to be written; may not be nullprotected void appendTwoDigitUnsignedInt(int value)
protected void appendFourDigitUnsignedInt(int value)
protected void appendSixDigitUnsignedInt(int value,
boolean trimTrailingZeros)
protected void appendDate(int year,
int month,
int day)
protected void appendTime(int hour,
int min,
int sec,
int microSeconds)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||