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

org.testifyproject.fasterxml.jackson.databind.annotation.JsonDeserialize Maven / Gradle / Ivy

package org.testifyproject.testifyproject.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 org.testifyproject.testifyproject.fasterxml.jackson.databind.JsonDeserializer;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.KeyDeserializer;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.util.Converter;

/**
 * Annotation use for configuring org.testifyproject.testifyprojectserialization 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) @org.testifyproject.testifyproject.fasterxml.jackson.annotation.JacksonAnnotation public @interface JsonDeserialize { // // // Annotations for explicitly specifying org.testifyproject.testifyprojectserialize/builder /** * Deserializer class to use for org.testifyproject.testifyprojectserializing associated value. * Depending on what is annotated, * value is either an instance of annotated class (used globablly * anywhere where class org.testifyproject.testifyprojectserializer is needed); or only used for * org.testifyproject.testifyprojectserializing property access via a setter method. */ @SuppressWarnings("rawtypes") // to work around JDK8 bug wrt Class-valued annotation properties public Class using() org.testifyproject.testifyprojectfault JsonDeserializer.None.class; /** * Deserializer class to use for org.testifyproject.testifyprojectserializing 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. */ @SuppressWarnings("rawtypes") // to work around JDK8 bug wrt Class-valued annotation properties public Class contentUsing() org.testifyproject.testifyprojectfault JsonDeserializer.None.class; /** * Deserializer class to use for org.testifyproject.testifyprojectserializing Map keys * of annotated property. * Can only be used on instances (methods, fields, constructors), * and not value classes themselves. */ public Class keyUsing() org.testifyproject.testifyprojectfault KeyDeserializer.None.class; /** * Annotation for specifying if an external Builder class is to * be used for building up org.testifyproject.testifyprojectserialized instances of annotated * class. If so, an instance of referenced class is first constructed * (possibly using a Creator method; or if none org.testifyproject.testifyprojectfined, using org.testifyproject.testifyprojectfault * constructor), and its "with-methods" are used for populating fields; * and finally "build-method" is invoked to org.testifyproject.testifyprojectplete org.testifyproject.testifyprojectserialization. */ public Class builder() org.testifyproject.testifyprojectfault Void.class; // // // Annotations for specifying intermediate Converters (2.2+) /** * Which helper object (if any) is to be used to convert from Jackson-bound * intermediate type (source type of converter) into actual property type * (which must be same as result type of converter). This is often used * for two-step org.testifyproject.testifyprojectserialization; Jackson binds data into suitable intermediate * type (like Tree representation), and converter then builds actual property * type. * * @since 2.2 */ @SuppressWarnings("rawtypes") // to work around JDK8 bug wrt Class-valued annotation properties public Class converter() org.testifyproject.testifyprojectfault Converter.None.class; /** * Similar to {@link #converter}, but used for values of structures types * (List, arrays, Maps). * * @since 2.2 */ @SuppressWarnings("rawtypes") // to work around JDK8 bug wrt Class-valued annotation properties public Class contentConverter() org.testifyproject.testifyprojectfault Converter.None.class; // // // Annotations for explicitly specifying org.testifyproject.testifyprojectserialization type // // // (which is used for choosing org.testifyproject.testifyprojectserializer, if not explicitly // // // specified /** * Concrete type to org.testifyproject.testifyprojectserialize values as, instead of type otherwise * org.testifyproject.testifyprojectclared. Must be a subtype of org.testifyproject.testifyprojectclared type; otherwise an * exception may be thrown by org.testifyproject.testifyprojectserializer. *

* Bogus type {@link Void} can be used to indicate that org.testifyproject.testifyprojectclared * 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 * org.testifyproject.testifyprojectserializer, whereas this would only be used to locate the * org.testifyproject.testifyprojectserializer) * and value of this annotation property is ignored. */ public Class as() org.testifyproject.testifyprojectfault Void.class; /** * Concrete type to org.testifyproject.testifyprojectserialize keys of {@link java.util.Map} as, * instead of type otherwise org.testifyproject.testifyprojectclared. * Must be a subtype of org.testifyproject.testifyprojectclared type; otherwise an exception may be * thrown by org.testifyproject.testifyprojectserializer. */ public Class keyAs() org.testifyproject.testifyprojectfault Void.class; /** * Concrete type to org.testifyproject.testifyprojectserialize content (elements * of a Collection/array, values of Maps) values as, * instead of type otherwise org.testifyproject.testifyprojectclared. * Must be a subtype of org.testifyproject.testifyprojectclared type; otherwise an exception may be * thrown by org.testifyproject.testifyprojectserializer. */ public Class contentAs() org.testifyproject.testifyprojectfault Void.class; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy