com.github.shyiko.mysql.binlog.event.deserialization.json
Interface JsonFormatter

All Known Implementing Classes:
JsonStringFormatter

public interface JsonFormatter

Handle the various actions involved when JsonBinary.parse(byte[], JsonFormatter) a JSON binary value.

Author:
Randall Hauch

Method Summary
 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.
 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.
 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.
 

Method Detail

beginObject

void beginObject(int numElements)
Prepare to receive the name-value pairs in a JSON object.

Parameters:
numElements - the number of name-value pairs (or elements)

beginArray

void beginArray(int numElements)
Prepare to receive the value pairs that in a JSON array.

Parameters:
numElements - the number of array elements

endObject

void endObject()
Complete the previously-started JSON object.


endArray

void endArray()
Complete the previously-started JSON array.


name

void name(String name)
Receive the name of an element in a JSON object.

Parameters:
name - the element's name; never null

value

void value(String value)
Receive the string value of an element in a JSON object.

Parameters:
value - the element's value; never null

value

void value(int value)
Receive the integer value of an element in a JSON object.

Parameters:
value - the element's value

value

void value(long value)
Receive the long value of an element in a JSON object.

Parameters:
value - the element's value

value

void value(double value)
Receive the double value of an element in a JSON object.

Parameters:
value - the element's value

value

void value(BigInteger value)
Receive the BigInteger value of an element in a JSON object.

Parameters:
value - the element's value; never null

value

void value(BigDecimal value)
Receive the BigDecimal value of an element in a JSON object.

Parameters:
value - the element's value; never null

value

void value(boolean value)
Receive the boolean value of an element in a JSON object.

Parameters:
value - the element's value

valueNull

void valueNull()
Receive a null value of an element in a JSON object.


valueYear

void valueYear(int year)
Receive the year value of an element in a JSON object.

Parameters:
year - the year number that makes up the element's value

valueDate

void valueDate(int year,
               int month,
               int day)
Receive the date value of an element in a JSON object.

Parameters:
year - the positive or negative year in the element's date value
month - the month (0-12) in the element's date value
day - the day of the month (0-31) in the element's date value

valueDatetime

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.

Parameters:
year - the positive or negative year in the element's date value
month - the month (0-12) in the element's date value
day - the day of the month (0-31) in the element's date value
hour - the hour of the day (0-24) in the element's time value
min - the minutes of the hour (0-60) in the element's time value
sec - the seconds of the minute (0-60) in the element's time value
microSeconds - the number of microseconds in the element's time value

valueTime

void valueTime(int hour,
               int min,
               int sec,
               int microSeconds)
Receive the time value of an element in a JSON object.

Parameters:
hour - the hour of the day (0-24) in the element's time value
min - the minutes of the hour (0-60) in the element's time value
sec - the seconds of the minute (0-60) in the element's time value
microSeconds - the number of microseconds in the element's time value

valueTimestamp

void valueTimestamp(long secondsPastEpoch,
                    int microSeconds)
Receive the timestamp value of an element in a JSON object.

Parameters:
secondsPastEpoch - the number of seconds past epoch (January 1, 1970) in the element's timestamp value
microSeconds - the number of microseconds in the element's time value

valueOpaque

void valueOpaque(ColumnType type,
                 byte[] value)
Receive an opaque value of an element in a JSON object.

Parameters:
type - the column type for the value; may not be null
value - the binary representation for the element's value

nextEntry

void nextEntry()
Called after an entry signaling that another entry will be signaled.



Copyright © 2016. All Rights Reserved.