@Retention(value=RUNTIME) @Target(value=TYPE) public @interface AdaptationType
AdaptationDecoder
- one AdaptationEncoder
A type may also support a number of variants()
, e.g. "inap", or "cap".
Variants are inherited from AdaptationType
annotations on interfaces and superclasses.
A type may also provide a number of constraints()
, e.g. AdaptationConstraint.CHOICE_TYPE
.
A type may define a AdaptationDescription
, to be used as the human readable description
of the generated schema type.
Note: annotations marked in inherited methods take effect,
unless the method is over-ridden by a subclass.
An adaptation type may be either a 'record adaptation type', or a 'generic adaptation type'.
AdaptationGetter
for each adaptation field
- one AdaptationConstructor
The adaptation class can choose one of 2 different ways to construct the object from individual fields:
either (1) the annotation constructor takes a parameter for each field, with no setters,
or (2) the constructor takes no arguments, and the type declares an AdaptationSetter
for each adaptation field.
Fields which are optional (whose values may be null) mark their getter methods
with the @AdaptationNullable annotation.
Example usage for a record adaptation type:
@AdaptationType(variants = {"inap","cap"}) public class SomeDataType {...}
@AdaptationType(variants = {"inap","cap"}) public class SomeDataType {...}Example usage of a generic adaptation, when specifying another class to use as the adaptation type:
@AdaptationType(adaptationClass = int.class) public static class IntAdaptation {...}
Modifier and Type | Optional Element and Description |
---|---|
Class<?> |
adaptationClass
Optional.
|
AdaptationConstraint[] |
constraints
Constraints which should be placed on the generated schema type.
|
String[] |
variants
Supported variants.
|
public abstract String[] variants
public abstract AdaptationConstraint[] constraints
public abstract Class<?> adaptationClass