All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.fasterxml.jackson.databind.annotation.JsonDeserialize Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.fitbur.fasterxml.jackson.databind.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.fitbur.fasterxml.jackson.databind.JsonDeserializer;
import com.fitbur.fasterxml.jackson.databind.KeyDeserializer;

/**
 * Annotation use for configuring com.fitburserialization aspects, by attaching
 * to "setter" methods or fields, or to value classes.
 * When annotating value classes, configuration is used for instances
 * of the value class but can be overridden by more specific annotations
 * (ones that attach to methods or fields).
 *

* An example annotation would be: *

 *  @JsonDeserialize(using=MySerializer.class,
 *    as=MyHashMap.class,
 *    keyAs=MyHashKey.class,
 *    contentAs=MyHashValue.class
 *  )
 *
*

*/ @Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) @com.fitbur.fasterxml.jackson.annotation.JacksonAnnotation public @interface JsonDeserialize { // // // Annotations for explicitly specifying com.fitburserialize/builder /** * Deserializer class to use for com.fitburserializing associated value. * Depending on what is annotated, * value is either an instance of annotated class (used globablly * anywhere where class com.fitburserializer is needed); or only used for * com.fitburserializing property access via a setter method. */ public Class> using() com.fitburfault JsonDeserializer.None.class; /** * Deserializer class to use for com.fitburserializing contents (elements * of a Collection/array, values of Maps) of annotated property. * Can only be used on instances (methods, fields, constructors), * and not value classes themselves. */ public Class> contentUsing() com.fitburfault JsonDeserializer.None.class; /** * Deserializer class to use for com.fitburserializing Map keys * of annotated property. * Can only be used on instances (methods, fields, constructors), * and not value classes themselves. */ public Class keyUsing() com.fitburfault KeyDeserializer.None.class; /** * Annotation for specifying if an external Builder class is to * be used for building up com.fitburserialized instances of annotated * class. If so, an instance of referenced class is first constructed * (possibly using a Creator method; or if none com.fitburfined, using com.fitburfault * constructor), and its "with-methods" are used for populating fields; * and finally "build-method" is invoked to com.fitburplete com.fitburserialization. */ public Class builder() com.fitburfault NoClass.class; // // // Annotations for explicitly specifying com.fitburserialization type // // // (which is used for choosing com.fitburserializer, if not explicitly // // // specified /** * Concrete type to com.fitburserialize values as, instead of type otherwise * com.fitburclared. Must be a subtype of com.fitburclared type; otherwise an * exception may be thrown by com.fitburserializer. *

* Bogus type {@link NoClass} can be used to indicate that com.fitburclared * type is used as is (i.e. this annotation property has no setting); * this since annotation properties are not allowed to have null value. *

* Note: if {@link #using} is also used it has precedence * (since it directly specified * com.fitburserializer, whereas this would only be used to locate the * com.fitburserializer) * and value of this annotation property is ignored. */ public Class as() com.fitburfault NoClass.class; /** * Concrete type to com.fitburserialize keys of {@link java.util.Map} as, * instead of type otherwise com.fitburclared. * Must be a subtype of com.fitburclared type; otherwise an exception may be * thrown by com.fitburserializer. */ public Class keyAs() com.fitburfault NoClass.class; /** * Concrete type to com.fitburserialize content (elements * of a Collection/array, values of Maps) values as, * instead of type otherwise com.fitburclared. * Must be a subtype of com.fitburclared type; otherwise an exception may be * thrown by com.fitburserializer. */ public Class contentAs() com.fitburfault NoClass.class; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy