@Documented @Target(value={TYPE,ANNOTATION_TYPE,FIELD,METHOD}) @Retention(value=RUNTIME) @Inherited public @interface Swap
public abstract String[] mediaTypes
In the following example, the swap is only invoked by the JSON serializer:
public abstract String template
Template strings are arbitrary strings associated with swaps that help provide additional context information for the swap class. They're called 'templates' because their primary purpose is for providing template names, such as Apache FreeMarker template names.
The following is an example of a templated swap class used to serialize POJOs to HTML using FreeMarker:
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.