@Retention(value=RUNTIME) @Target(value=TYPE) public @interface DataObject
JsonObject
List
setter type declares a multi valued property, otherwise it declares
a single valued property.
An adder is a method prefixed by add
, its purpose is to declare a List
of properties.
An adder declares a multi valued property, mapped to the JsonArray
type. An adder
and a multi valued setter of the same property name are naturally compatible and is encouraged.
Properties types can be:
JsonObject
JsonArray
List
of abovetoJson()
method that takes no arguments and returns a JsonObject
representing
the data object as a JsonObject
.
Vert.x core will generate a json converters using annotation processing to ease conversion, for a given data object,
a converter is generated, the name of this converter is the name of the data object with the Converter suffix.
The converter has a fromJson(JsonObject,T)
and a toJson(T,JsonObject)
public static methods, such methods
can be used by the json constructor or the toJson()
method to implement the conversion code. By default the
generated methods only handle the conversion of the property of the data object and do not handle the properties of the
ancestors of this data object, inheritConverter()
can be set to true to change this behavior and handle the
conversion of the inherited properties as well. The converter generation can be prevented with the
generateConverter()
annotation member.Modifier and Type | Optional Element and Description |
---|---|
String |
base64Type
Returns the expected Base64 (RFC 4648) type to be used.
|
boolean |
generateConverter |
boolean |
inheritConverter |
Class<? extends Case> |
jsonPropertyNameFormatter |
boolean |
publicConverter |
public abstract boolean generateConverter
public abstract boolean inheritConverter
public abstract boolean publicConverter
public abstract String base64Type
base64url
, unless the
system property vertx.json.base64
is legacy
. In this case the alphabet will
be basic
as it was during the vert.x 3.x releases.
Allowed values are:
"base64url"
- Base64 URL and Filename Safe as defined in (RFC 4648 Table 2) "basic"
- Base64 Basic as defined in (RFC 4648 Table 1) Copyright © 2021 Eclipse. All rights reserved.