@Documented @Target(value=TYPE) @Retention(value=RUNTIME) @Inherited public @interface Json
Can be applied to Java types.
Can be used for the following:
Modifier and Type | Optional Element and Description |
---|---|
String |
wrapperAttr
Wraps beans in a JSON object with the specified attribute name.
|
public abstract String wrapperAttr
Applies only to ElementType.TYPE
.
This annotation can be applied to beans as well as other objects serialized to other types (e.g. strings).
Without the
{ f1: 123 }
With the annotations, serializing this bean as JSON produces the following...
{ myWrapper: { f1: 123 } }
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.