Skip to content

Commit

Permalink
Merge pull request #83 from AlejandroRivera/feature/deserialize-unkno…
Browse files Browse the repository at this point in the history
…wn-enums-using-default

Added new `@JsonEnumDefaultValue` annotation.
  • Loading branch information
cowtowncoder committed Feb 23, 2016
2 parents dc70104 + c22a052 commit 737cac6
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.fasterxml.jackson.annotation;

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

/**
* Marker annotation that can be used to define a default value
* used when trying to deserialize unknown Enum values.
* <p>
* This annotation is only applicable when the <code>@READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE</code>
* deserialization feature is enabled.
* <p>
* If the more than one enum value is marked with this annotation,
* the first one to be detected will be used. Which one exactly is undetermined.
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonEnumDefaultValue
{

}

0 comments on commit 737cac6

Please sign in to comment.