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

de.bild.codec.annotations.DecodingFieldFailureStrategy Maven / Gradle / Ivy

Go to download

A very fast POJO codec for MongoDB (used in conjunction with the Mongo Java Driver) that handles generic types as well as polymorphic class hierarchies

The newest version!
package de.bild.codec.annotations;

import java.lang.annotation.*;

/**
 * Use this annotation on pjo fields to define the codec behaviour in case of field decoding errors.
 * Strategies are:
 *
 * SET_TO_NULL - ignore exception and set field to null
 * RETHROW_EXCEPTION - rethrow the exception
 * SKIP - ignore the exception and leave the field to it's initial value
 *
 *
 * @since 2.5.0
 */
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface DecodingFieldFailureStrategy {
    Strategy value() default Strategy.RETHROW_EXCEPTION;

    enum Strategy {
        SET_TO_NULL,
        RETHROW_EXCEPTION,
        SKIP
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy