001/* 002 * SPDX-FileCopyrightText: none 003 * SPDX-License-Identifier: CC0-1.0 004 */ 005 006package dev.metaschema.databind.codegen.config; 007 008import edu.umd.cs.findbugs.annotations.NonNull; 009import edu.umd.cs.findbugs.annotations.Nullable; 010 011/** 012 * Provides binding configuration for a choice group within an assembly 013 * definition. 014 * 015 * <p> 016 * Choice group bindings enable fine-grained control over code generation for 017 * choice groups, particularly for specifying custom collection types with 018 * type-safe item bounds. 019 */ 020public interface IChoiceGroupBindingConfiguration { 021 022 /** 023 * Get the name of the choice group to match. 024 * 025 * <p> 026 * This name corresponds to the {@code group-as} name specified in the 027 * Metaschema module for the choice group. 028 * 029 * @return the choice group name 030 */ 031 @NonNull 032 String getGroupAsName(); 033 034 /** 035 * Get the fully qualified Java type name to use for collection items. 036 * 037 * <p> 038 * When specified, the generated field and getter will use this type instead of 039 * {@link Object} for the collection item type. This allows for type-safe 040 * collections when all choice alternatives share a common supertype. 041 * 042 * @return the fully qualified Java type name, or {@code null} if not specified 043 */ 044 @Nullable 045 String getItemTypeName(); 046 047 /** 048 * Determine whether to use a wildcard bounded type for the collection. 049 * 050 * <p> 051 * When {@code true}, generates {@code List<? extends Type>} instead of 052 * {@code List<Type>}. This provides additional flexibility when the exact item 053 * type may vary while still maintaining type safety. 054 * 055 * <p> 056 * Defaults to {@code true} if an item type is specified. 057 * 058 * @return {@code true} to use wildcard bounds, {@code false} otherwise 059 */ 060 boolean isUseWildcard(); 061}