|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
JsonSerialize
instead
@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) public @interface JsonUseSerializer
Annotation that can be used to explicitly mark
JsonSerializer
used to serialize
instances of the class annotated, or the value of property
that is accessed using (getter) method annotated.
There is a special marker Class (NoClass
) that can be used to
indicate that no explicit serializer is to be used -- such a
work-around is needed because 'null' can not be used with
annotations (either as default or explicit value)
Note that although type serializers do have generic type information,
that information is not available during processing. As a result,
only thing that can be checked during annotation processing
is that class used does indeed implement
JsonSerializer
; but not whether
it declares that it can handle type given.
Note also that this method does NOT imply that the associated
method (when applied to one) is implicitly a getter:
rather, it must be recognized as one either due to its naming,
or by associated JsonGetter
annotation.
Optional Element Summary | |
---|---|
Class<?> |
value
Deprecated. Class to instantiate to get the serializer instance used for serializing associated value. |
public abstract Class<?> value
Note: default value, NoClass.class
can be used
to denote that no explicit serializer is to be used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |