Class DefaultChoiceGroupBindingConfiguration

java.lang.Object
dev.metaschema.databind.codegen.config.DefaultChoiceGroupBindingConfiguration
All Implemented Interfaces:
IChoiceGroupBindingConfiguration

public class DefaultChoiceGroupBindingConfiguration extends Object implements IChoiceGroupBindingConfiguration
Default implementation of IChoiceGroupBindingConfiguration.

This implementation wraps a MetaschemaBindings.MetaschemaBinding.DefineAssemblyBinding.ChoiceGroupBinding instance from the binding configuration and provides the configuration interface methods.

The class stores:

  • The required group-as name (guaranteed non-null from the schema)
  • The optional fully-qualified Java type name for collection items
  • A flag indicating whether to use wildcard bounded types (defaults to true)
  • Constructor Details

  • Method Details

    • getGroupAsName

      @NonNull public String getGroupAsName()
      Description copied from interface: IChoiceGroupBindingConfiguration
      Get the name of the choice group to match.

      This name corresponds to the group-as name specified in the Metaschema module for the choice group.

      Specified by:
      getGroupAsName in interface IChoiceGroupBindingConfiguration
      Returns:
      the choice group name
    • getItemTypeName

      @Nullable public String getItemTypeName()
      Description copied from interface: IChoiceGroupBindingConfiguration
      Get the fully qualified Java type name to use for collection items.

      When specified, the generated field and getter will use this type instead of Object for the collection item type. This allows for type-safe collections when all choice alternatives share a common supertype.

      Specified by:
      getItemTypeName in interface IChoiceGroupBindingConfiguration
      Returns:
      the fully qualified Java type name, or null if not specified
    • isUseWildcard

      public boolean isUseWildcard()
      Description copied from interface: IChoiceGroupBindingConfiguration
      Determine whether to use a wildcard bounded type for the collection.

      When true, generates List<? extends Type> instead of List<Type>. This provides additional flexibility when the exact item type may vary while still maintaining type safety.

      Defaults to true if an item type is specified.

      Specified by:
      isUseWildcard in interface IChoiceGroupBindingConfiguration
      Returns:
      true to use wildcard bounds, false otherwise