{8.1.0-new} Configurable Annotations

Config annotations allow you to define serializer and parser properties using specialized annotations. All configuration properties have annotation-equivalents.

The following shows the difference between the two approaches:

Example:

// Servlet with properties applied @Rest( properties={ @Property(name=BEAN_sortProperties, value="true"), @Property(name=SERIALIZER_trimNulls, value="true"), @Property(name=JSON_escapeSolidus, value="true") } ) public MyRestServlet extends BasicRestServlet {...}

// Servlet with config annotations applied @Rest( ... ) @BeanConfig(sortProperties="true") @SerializerConfig(trimNulls="true") @JsonConfig(escapeSolidus="true") public MyRestServlet extends BasicRestServlet {...}

Using config annotations is often cleaner and supports the same SVL variable support as those in the REST annotations.

Config annotations are defined for all serializers and parsers:

Config annotations can be defined at both the class and method level just like properties.