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

com.github.peckb1.processor.AutoJackson Maven / Gradle / Ivy

package com.github.peckb1.processor;

import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;

/**
 * 

* Our main annotation which if applied to an interface will create * a custom deserializer, and possibly the needed base implementation * class to serialize to, and deserialize from JSON data using * Jackson deserialization. *

* For Example: *
 * {@literal @}AutoJackson
 *  public interface Steak {
 *     {@literal @}Named("done") Boolean isDone();
 *  }
 * 
 * 
* Would create a class similar to: *
 * {@literal @}JsonInclude(JsonInclude.Include.NON_EMPTY)
 *  public final class Steak_AutoJacksonImpl implements Steak {
 *
 *      private static final String DONE = "done";
 *
 *     {@literal @}JsonProperty(value = DONE, required = true)
 *      private final Boolean done;
 *
 *      public Steak_AutoJacksonImpl(@JsonProperty(value = DONE, required = true) Boolean done) {
 *          this.age = done;
 *      }
 *
 *      public Boolean isDone() {
 *          return this.done;
 *      }
 *
 * }
 * 
 * 
* And a deserializer which can be registered with an ObjectMapper that will use the * concrete class to create instances of the original annotated instance. */ @Target(TYPE) public @interface AutoJackson { Type type() default @Type(value = NoTypeEnum.class); @interface Type { Class value(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy