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 if Option.FLATTENED_SUPPLIER is enabled, but re-usable for other generic wrappers.
Since:
4.25.0
  • Constructor Details

    • FlattenedWrapperModule

      public FlattenedWrapperModule(Class<W> wrapperType)
      Constructor setting the type to unwrap.
      Parameters:
      wrapperType - wrapper type (e.g., Optional or Supplier)
  • 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

      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 interface Module
      Parameters:
      builder - configuration builder instance to which to apply this module