Skip to content

Commit 737cac6

Browse files
committed
Merge pull request #83 from AlejandroRivera/feature/deserialize-unknown-enums-using-default
Added new `@JsonEnumDefaultValue` annotation.
2 parents dc70104 + c22a052 commit 737cac6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.fasterxml.jackson.annotation;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
/**
9+
* Marker annotation that can be used to define a default value
10+
* used when trying to deserialize unknown Enum values.
11+
* <p>
12+
* This annotation is only applicable when the <code>@READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE</code>
13+
* deserialization feature is enabled.
14+
* <p>
15+
* If the more than one enum value is marked with this annotation,
16+
* the first one to be detected will be used. Which one exactly is undetermined.
17+
*/
18+
@Target(ElementType.FIELD)
19+
@Retention(RetentionPolicy.RUNTIME)
20+
@JacksonAnnotation
21+
public @interface JsonEnumDefaultValue
22+
{
23+
24+
}

0 commit comments

Comments
 (0)