Top Description Methods
io.vertx.core.parsetools

public Interface JsonEvent

Known Direct Implementers
io.vertx.core.parsetools.impl.JsonEventImpl
Annotations
@VertxGen
Imports
com.fasterxml.jackson.core.type.TypeReference, io.vertx.codegen.annotations.GenIgnore, .VertxGen, io.vertx.core.buffer.Buffer, io.vertx.core.json.JsonArray, .JsonObject, java.time.Instant

A JSON event emited by the JsonParser.
Author
Julien Viet

Method Summary

Modifier and TypeMethod and Description
public JsonArray

Returns:

the JSON array value or null if the event has no JSON value
arrayValue
()
References Deprecated JsonArray is deprecated or references (maybe indirectly) at least one deprecated element.

public Buffer

Returns:

the binary value or null if the event has no JSON value
binaryValue
()
References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Return the binary value.

public Boolean

Returns:

the Boolean value or null if the event has no JSON value
booleanValue
()

public Double

Returns:

the Double value or null if the event has no JSON value
doubleValue
()

public String

Returns:

the name of the field when the event is emitted as a JSON object member
fieldName
()

public Float

Returns:

the Float value or null if the event has no JSON value
floatValue
()

public Instant

Returns:

the Instant value or null if the event has no JSON value
instantValue
()

Return the Instant value.

public Integer

Returns:

the Integer value or null if the event has no JSON value
integerValue
()

public boolean

Returns:

true when the JSON value is a JSON array
isArray
()

public boolean

Returns:

true when the JSON value is a boolean
isBoolean
()

public boolean

Returns:

true when the JSON value is null
isNull
()

public boolean

Returns:

true when the JSON value is a number
isNumber
()

public boolean

Returns:

true when the JSON value is a JSON object
isObject
()

public boolean

Returns:

true when the JSON value is a string
isString
()

public Long

Returns:

the Long value or null if the event has no JSON value
longValue
()

public <T> T

Returns:

the decoded value
mapTo
(Class<T>
the type to decode the value to
type
)

Decodes and returns the current value as the specified type.

public <T> T

Returns:

the decoded value
mapTo
(TypeReference<T>
the type to decode the value to
type
)

Decodes and returns the current value as the specified type.

public JsonObject

Returns:

the JSON object value or null if the event has no JSON value
objectValue
()
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

public String

Returns:

the string value or null if the event has no JSON value
stringValue
()

public JsonEventType

Returns:

the type of the event
type
()

public Object

Returns:

the json value for JsonEventType#VALUE events
value
()

Method Detail

arrayValueback to summary
public JsonArray arrayValue()

References Deprecated

JsonArray is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns:JsonArray

the JSON array value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not a JSON array
binaryValueback to summary
public Buffer binaryValue()

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Return the binary value.

JSON itself has no notion of a binary, this extension complies to the RFC-7493, so this method assumes there is a String value with the key and it contains a Base64 encoded binary, which it decodes if found and returns.

Returns:Buffer

the binary value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not a String
IllegalArgumentException:
if the String value is not a legal Base64 encoded value
booleanValueback to summary
public Boolean booleanValue()
Returns:Boolean

the Boolean value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not a Boolean
doubleValueback to summary
public Double doubleValue()
Returns:Double

the Double value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not a Double
fieldNameback to summary
public String fieldName()
Returns:String

the name of the field when the event is emitted as a JSON object member

floatValueback to summary
public Float floatValue()
Returns:Float

the Float value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not a Float
instantValueback to summary
public Instant instantValue()

Return the Instant value.

JSON itself has no notion of a temporal types, this extension complies to the RFC-7493, so this method assumes there is a String value with the key and it contains an ISO 8601 encoded date and time format such as "2017-04-03T10:25:41Z", which it decodes if found and returns.

Returns:Instant

the Instant value or null if the event has no JSON value

Annotations
@GenIgnore:permitted-type
Exceptions
ClassCastException:
if the value is not a String
DateTimeParseException:
if the String value is not a legal ISO 8601 encoded value
integerValueback to summary
public Integer integerValue()
Returns:Integer

the Integer value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not an Integer
isArrayback to summary
public boolean isArray()
Returns:boolean

true when the JSON value is a JSON array

isBooleanback to summary
public boolean isBoolean()
Returns:boolean

true when the JSON value is a boolean

isNullback to summary
public boolean isNull()
Returns:boolean

true when the JSON value is null

isNumberback to summary
public boolean isNumber()
Returns:boolean

true when the JSON value is a number

isObjectback to summary
public boolean isObject()
Returns:boolean

true when the JSON value is a JSON object

isStringback to summary
public boolean isString()
Returns:boolean

true when the JSON value is a string

longValueback to summary
public Long longValue()
Returns:Long

the Long value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not a Long
mapToback to summary
public <T> T mapTo(Class<T> type)

Decodes and returns the current value as the specified type.

Parameters
type:Class<T>

the type to decode the value to

Returns:T

the decoded value

mapToback to summary
public <T> T mapTo(TypeReference<T> type)

Decodes and returns the current value as the specified type.

Parameters
type:TypeReference<T>

the type to decode the value to

Returns:T

the decoded value

Annotations
@GenIgnore:permitted-type
objectValueback to summary
public JsonObject objectValue()

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns:JsonObject

the JSON object value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not a JSON object
stringValueback to summary
public String stringValue()
Returns:String

the string value or null if the event has no JSON value

Exceptions
ClassCastException:
if the value is not a string
typeback to summary
public JsonEventType type()
Returns:JsonEventType

the type of the event

valueback to summary
public Object value()
Returns:Object

the json value for JsonEventType#VALUE events