|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Target(value=METHOD) @Retention(value=RUNTIME) public @interface JsonClass
Annotation that can be used to mark "setter" methods to indicate the actual type of the logical property associated with the method. This is usually done if the declared type is abstract or too generic; annotation can denote actual concrete type to instantiate when deserializing the property.
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.
Note too that for container types (arrays, Lists/Collections/Maps) this
indicates the type of container itself; for contained Objects, use
JsonContentClass instead (or for Map keys,
JsonKeyClass).
| Required Element Summary | |
|---|---|
java.lang.Class<?> |
value
Class that is the expected concrete type of the property associated with the annotated method. |
| Element Detail |
|---|
public abstract java.lang.Class<?> value
Note: if a non-property related method is annotated with this annotation, deserializer will throw an exception to denote invalid annotation. If used with a "getter" method, usage is not illegal, but will not be used for anything.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||