Top Description Methods
io.vertx.codegen.annotations

public @Interface DataObject

extends Annotation
Annotations
@Retention:RUNTIME
@Target:TYPE
Imports
io.vertx.codegen.format.Case, .LowerCamelCase, java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Declares a data object, such object must provide at least:

When the data object is processed, a model of properties from the setter methods or adder methods. Single valued and multi valued properties are supported.

A setter is just like a JavaBean setter, however the method return type shall be fluent and return the current object. A java.util.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 java.util.List of properties. An adder declares a multi valued property, mapped to the io.vertx.core.json.JsonArray type. An adder and a multi valued setter of the same property name are naturally compatible and is encouraged.

Properties types can be:

A data object can be an interface or an abstract class to accomodate the api design. Data object can extend other data objects.

Sometimes data object can have a toJson() method that takes no arguments and returns a JsonObject representing the data object as a JsonObject.

Author
Tim Fox

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

if generated converters are enabled, buffers should default to the configured type.
base64Type
()

Returns the expected Base64 (RFC 4648) type to be used.

public boolean

Returns:

true if converter should be generated for the data object
generateConverter
()
Deprecated instead declare a io.vertx.codegen.json.annotations.JsonGen annotation

public boolean

Returns:

true if the converter should handle the state of the ancestors.
inheritConverter
()

public Class<? extends Case>

Returns:

the case class specifying how the data object converter properties will be translated to JSON element names.
jsonPropertyNameFormatter
()

public boolean

Returns:

whether the generated converter should be public or package private
publicConverter
()

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

base64Typeback to summary
public String base64Type()

Returns the expected Base64 (RFC 4648) type to be used. When omitted, his is vert.x default alphabet, usually (RFC 4648 Table 2) also known as 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)
Returns:String

if generated converters are enabled, buffers should default to the configured type.

Annotations
@Deprecated
generateConverterback to summary
public boolean generateConverter()

Deprecated

instead declare a io.vertx.codegen.json.annotations.JsonGen annotation

Returns:boolean

true if converter should be generated for the data object

Annotations
@Deprecated
inheritConverterback to summary
public boolean inheritConverter()
Returns:boolean

true if the converter should handle the state of the ancestors.

Annotations
@Deprecated
jsonPropertyNameFormatterback to summary
public Class<? extends Case> jsonPropertyNameFormatter()
Returns:Class<? extends Case>

the case class specifying how the data object converter properties will be translated to JSON element names.

Annotations
@Deprecated
publicConverterback to summary
public boolean publicConverter()
Returns:boolean

whether the generated converter should be public or package private

Annotations
@Deprecated