Class FlattenedWrapperModule<W>
java.lang.Object
com.github.victools.jsonschema.generator.impl.module.FlattenedWrapperModule<W>
- Type Parameters:
W- type of the generic wrapper, which presumably has at least on type parameter from which to derive the actual schema
- All Implemented Interfaces:
Module
- Direct Known Subclasses:
FlattenedOptionalModule
Default module being included if
Option.FLATTENED_SUPPLIER is enabled, but re-usable for other generic wrappers.- Since:
- 4.25.0
-
Constructor Summary
ConstructorsConstructorDescriptionFlattenedWrapperModule(Class<W> wrapperType) Constructor setting the type to unwrap. -
Method Summary
Modifier and TypeMethodDescriptionvoidApply this module to the given configuration builder instance.protected booleanhasMemberWrapperType(MemberScope<?, ?> member) Determine whether the given field/method's declared type is assignable to the targeted wrapper type.protected booleanisWrapperType(com.fasterxml.classmate.ResolvedType type) Check whether the given type is an instance of the predefined wrapper class.
-
Constructor Details
-
FlattenedWrapperModule
Constructor setting the type to unwrap.- Parameters:
wrapperType- wrapper type (e.g.,OptionalorSupplier)
-
-
Method Details
-
isWrapperType
protected boolean isWrapperType(com.fasterxml.classmate.ResolvedType type) Check whether the given type is an instance of the predefined wrapper class.- Parameters:
type- type to check for assignability to wrapper class- Returns:
- whether the given type is deemed to be of the targeted wrapper type in the context of this module
-
hasMemberWrapperType
Determine whether the given field/method's declared type is assignable to the targeted wrapper type.- Parameters:
member- field/method to check declared type of (also considering if it's a "fake container item scope")- Returns:
- whether the declared type is deemed relevant in the context of this module
-
applyToConfigBuilder
Description copied from interface:ModuleApply this module to the given configuration builder instance.- Specified by:
applyToConfigBuilderin interfaceModule- Parameters:
builder- configuration builder instance to which to apply this module
-