@Target(value={ANNOTATION_TYPE,TYPE_USE,TYPE}) @Retention(value=RUNTIME) @Repeatable(value=SchemaSwaps.class) public @interface SchemaSwap
SchemaFrom for cases when the classes
are coming from an external source and fields cannot be annotated directly.SchemaFrom| Modifier and Type | Required Element and Description |
|---|---|
String |
fieldName
Name of the field whose type is to be replaced.
|
Class<?> |
originalType
The owning class of the field whose type is to be replaced.
|
| Modifier and Type | Optional Element and Description |
|---|---|
int |
depth
For fields that may include a reference cycle, how many expansions to include in the output before including the
targetType() |
Class<?> |
targetType
The replacement schema that will be used for the
fieldName() instead of its specified type |
public abstract Class<?> originalType
It is an error if the type is not used in the same schema hierarchy where the SchemaSwap is used.
public abstract String fieldName
The name should be specified exactly as defined in the Java class, before any renames
and transformations (@JsonProperty and similar) take place.
It is an error if the field does not exist on originalType()
public abstract Class<?> targetType
fieldName() instead of its specified type
The default value of void.class causes the field to be skipped
public abstract int depth
targetType()
The default value of 0 replaces the field with the targetType() without any expansion
Copyright © 2015–2024 Red Hat. All rights reserved.