|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
JsonDeserialize.contentAs()
instead
@Target(value=METHOD) @Retention(value=RUNTIME) public @interface JsonContentClass
Annotation that can be used to mark "setter" methods to indicate the
actual type of values contained in a container type that is value
of the property associated with the method.
(phew! that's a mouthful!).
This is usually done if the declared element type is abstract or
too generic; annotation can denote actual concrete type to
instantiate when deserializing contents of the container.
To define type of the actual container itself, use
JsonClass
instead.
Note that the indicated type must be compatible with the declared type; that is, it has to be a sub-type or implementation of the declared type. This is usually the case; and if it wasn't then the call to associated "setter" method would fail with a type-mismatch exception.
Required Element Summary | |
---|---|
Class<?> |
value
Deprecated. Class that is the expected concrete value type of the container (which is value of the property associated with the annotated method). |
Element Detail |
---|
public abstract Class<?> value
Note: if a non-property method is annotated with this annotation, deserializer will throw an exception to denote invalid annotation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |