Interface DefinitionFeature<V,DB,XC,SD>
- Type Parameters:
V
- type for value of the feature (Boolean, String, or more complex type)DB
- definition builder (or mutable definition) object to which it's applicable when parsingXC
- source XSOM object that this feature can be parsed from;Object
meansXSComponent
orXSAnnotation
SD
- serializable definition object to which it's applicable when serializing
- All Known Implementing Classes:
AnnotationBasedFeature
,DefinitionFeature.DefaultImpl
public interface DefinitionFeature<V,DB,XC,SD>
An identifiable feature of a item or type definition. Currently, it supports parsing and sometimes also serialization.
For parsing, it knows:
. How to be parsed from XSOM (via
DefinitionFeatureParser
).
. How to be applied to the definition object or builder (via setterMethod()
).
For serialization:
. How to be taken from the definition (via DefinitionFeature.DefaultImpl.getterMethod
)
. How to be put into XSD DOM (via serializer()
).
Work in progress.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault <DB2> DefinitionFeature<V,
DB2, XC, SD> asForBuilder
(Class<DB2> builderClass) Used when we know that the feature will be applicable to given builder class, e.g., when passing as "extra feature" like inComplexTypeDefinition.ComplexTypeDefinitionLikeBuilder.getExtraFeaturesToParse()
.static <V,
DB, XC, SD>
DefinitionFeature<V,DB, XC, SD> of
(@NotNull Class<V> valueType, @NotNull Class<DB> setterInterface, @NotNull BiConsumer<DB, V> setterMethod, @NotNull DefinitionFeatureParser<V, XC> processor) static <V,
DB, XC, SD>
DefinitionFeature<V,DB, XC, SD> of
(@NotNull Class<V> valueType, @NotNull Class<DB> setterInterface, @NotNull BiConsumer<DB, V> setterMethod, @NotNull DefinitionFeatureParser<V, XC> parser, @NotNull Class<SD> serializableDefinitionType, @NotNull Function<SD, V> getterMethod, @NotNull DefinitionFeatureSerializer<V> serializer) Obtains the value from `source` (e.g.default V
parseIfApplicable
(DB target, XC source) void
serialize
(@NotNull SerializableDefinition source, @NotNull DefinitionFeatureSerializer.SerializationTarget target) Obtains the value from `source` definition and serializes it into `target` (e.g.default void
default boolean
settableOn
(@NotNull Object target) @NotNull BiConsumer<DB,
V> @NotNull DefinitionFeatureParser<V,
XC>
-
Method Details
-
of
static <V,DB, DefinitionFeature<V,XC, SD> DB, ofXC, SD> (@NotNull @NotNull Class<V> valueType, @NotNull @NotNull Class<DB> setterInterface, @NotNull @NotNull BiConsumer<DB, V> setterMethod, @NotNull @NotNull DefinitionFeatureParser<V, XC> processor) -
of
static <V,DB, DefinitionFeature<V,XC, SD> DB, ofXC, SD> (@NotNull @NotNull Class<V> valueType, @NotNull @NotNull Class<DB> setterInterface, @NotNull @NotNull BiConsumer<DB, V> setterMethod, @NotNull @NotNull DefinitionFeatureParser<V, XC> parser, @NotNull @NotNull Class<SD> serializableDefinitionType, @NotNull @NotNull Function<SD, V> getterMethod, @NotNull @NotNull DefinitionFeatureSerializer<V> serializer) -
valueType
-
definitionBuilderType
-
setterMethod
-
xsomParser
-
serializer
DefinitionFeatureSerializer<V> serializer() -
settableOn
-
set
-
parseIfApplicable
- Throws:
SchemaException
-
parse
Obtains the value from `source` (e.g. XSOM component) and sets it to `target` definition builder.- Throws:
SchemaException
-
serialize
void serialize(@NotNull @NotNull SerializableDefinition source, @NotNull @NotNull DefinitionFeatureSerializer.SerializationTarget target) Obtains the value from `source` definition and serializes it into `target` (e.g. DOM element in XSD). -
asForBuilder
Used when we know that the feature will be applicable to given builder class, e.g., when passing as "extra feature" like inComplexTypeDefinition.ComplexTypeDefinitionLikeBuilder.getExtraFeaturesToParse()
.
-