org.codehaus.jackson.annotate
Annotation Type JsonUseSerializer


Deprecated. As of version 1.1, use 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.
 

value

public abstract Class<?> value
Deprecated. 
Class to instantiate to get the serializer instance used for serializing associated value. Depending on what is annotated, value is either an instance of annotated class (used globablly anywhere where class serializer is needed); or only used for serializing property access via a getter method.

Note: default value, NoClass.class can be used to denote that no explicit serializer is to be used.

Default:
org.codehaus.jackson.annotate.NoClass.class