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
Modifier and TypeMethodDescriptionvoidbeginArray(int numElements) Prepare to receive the value pairs that in a JSON array.voidbeginObject(int numElements) Prepare to receive the name-value pairs in a JSON object.voidendArray()Complete the previously-started JSON array.voidComplete the previously-started JSON object.voidReceive the name of an element in a JSON object.voidCalled after an entry signaling that another entry will be signaled.voidvalue(boolean value) Receive the boolean value of an element in a JSON object.voidvalue(double value) Receive the double value of an element in a JSON object.voidvalue(int value) Receive the integer value of an element in a JSON object.voidvalue(long value) Receive the long value of an element in a JSON object.voidReceive the string value of an element in a JSON object.voidvalue(BigDecimal value) Receive theBigDecimalvalue of an element in a JSON object.voidvalue(BigInteger value) Receive theBigIntegervalue of an element in a JSON object.voidvalueDate(int year, int month, int day) Receive the date value of an element in a JSON object.voidvalueDatetime(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.voidReceive a null value of an element in a JSON object.voidvalueOpaque(ColumnType type, byte[] value) Receive an opaque value of an element in a JSON object.voidvalueTime(int hour, int min, int sec, int microSeconds) Receive the time value of an element in a JSON object.voidvalueTimestamp(long secondsPastEpoch, int microSeconds) Receive the timestamp value of an element in a JSON object.voidvalueYear(int year) Receive the year value of an element in a JSON object.
-
Method Details
-
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
Receive the name of an element in a JSON object.- Parameters:
name- the element's name; never null
-
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
Receive theBigIntegervalue of an element in a JSON object.- Parameters:
value- the element's value; never null
-
value
Receive theBigDecimalvalue 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 valuemonth- the month (0-12) in the element's date valueday- 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 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
-
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 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
-
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 valuemicroSeconds- the number of microseconds in the element's time value
-
valueOpaque
Receive an opaque value of an element in a JSON object.- Parameters:
type- the column type for the value; may not be nullvalue- the binary representation for the element's value
-
nextEntry
void nextEntry()Called after an entry signaling that another entry will be signaled.
-