Package io.micronaut.serde.annotation
Annotation Interface SerdeImport
@Internal
@Target(TYPE)
@Retention(RUNTIME)
@Repeatable(Repeated.class)
public @interface SerdeImport
Annotation to allow external classes to be enabled for serialization / deserialization.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Repeated wrapper for this annotation. -
Optional Element Summary
-
Element Details
-
value
Class<?> valueAllows making an external class or interface serializable.Note that mixins only work with publicly accessible members (constructors, getters/setters etc.), anything not public will not be includes in the serialization/deserialization result.
- Returns:
- The type to enable serialization for.
- Default:
- void.class
-
packageName
String packageNameSpecifies a package name where types can be found.Only publicly accessible types will be processed. Nested packages will not be processed and have to be defined explicitly.
- Returns:
- The package name where types can be found to import.
- Since:
- 2.2.2
- Default:
- ""
-
mixin
Class<?> mixinApply a mixin type. This is equivalent to JacksonobjectMapper.addMixInAnnotations(..)
allowing to mixin the annotations to the imported type.Any fields or methods that match fields or methods declared in the type specified to
value()
will have the annotations applied to the imported type.- Returns:
- The mixin type
- Default:
- void.class
-
serializable
boolean serializable- Returns:
- Whether to import for serialization. Defaults to
true
.
- Default:
- true
-
deserializable
boolean deserializable- Returns:
- Whether to import for deserialization. Defaults to
true
.
- Default:
- true
-