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
public class FlattenedWrapperModule<W> extends Object implements Module
Default module being included ifOption.FLATTENED_SUPPLIER
is enabled, but re-usable for other generic wrappers.- Since:
- 4.25.0
-
-
Constructor Summary
Constructors Constructor Description FlattenedWrapperModule(Class<W> wrapperType)
Constructor setting the type to unwrap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyToConfigBuilder(SchemaGeneratorConfigBuilder builder)
Apply this module to the given configuration builder instance.protected boolean
hasMemberWrapperType(MemberScope<?,?> member)
Determine whether the given field/method's declared type is assignable to the targeted wrapper type.protected boolean
isWrapperType(com.fasterxml.classmate.ResolvedType type)
Check whether the given type is an instance of the predefined wrapper class.
-
-
-
Method Detail
-
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
protected boolean hasMemberWrapperType(MemberScope<?,?> member)
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
public void applyToConfigBuilder(SchemaGeneratorConfigBuilder builder)
Description copied from interface:Module
Apply this module to the given configuration builder instance.- Specified by:
applyToConfigBuilder
in interfaceModule
- Parameters:
builder
- configuration builder instance to which to apply this module
-
-