Class DefaultChoiceGroupBindingConfiguration
- All Implemented Interfaces:
IChoiceGroupBindingConfiguration
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 Summary
ConstructorsConstructorDescriptionDefaultChoiceGroupBindingConfiguration(MetaschemaBindings.MetaschemaBinding.DefineAssemblyBinding.ChoiceGroupBinding binding) Constructs a new choice group binding configuration from a binding configuration object. -
Method Summary
Modifier and TypeMethodDescriptionGet the name of the choice group to match.Get the fully qualified Java type name to use for collection items.booleanDetermine whether to use a wildcard bounded type for the collection.
-
Constructor Details
-
DefaultChoiceGroupBindingConfiguration
public DefaultChoiceGroupBindingConfiguration(@NonNull MetaschemaBindings.MetaschemaBinding.DefineAssemblyBinding.ChoiceGroupBinding binding) Constructs a new choice group binding configuration from a binding configuration object.- Parameters:
binding- the binding configuration object from the parsed binding configuration file
-
-
Method Details
-
getGroupAsName
Description copied from interface:IChoiceGroupBindingConfigurationGet the name of the choice group to match.This name corresponds to the
group-asname specified in the Metaschema module for the choice group.- Specified by:
getGroupAsNamein interfaceIChoiceGroupBindingConfiguration- Returns:
- the choice group name
-
getItemTypeName
Description copied from interface:IChoiceGroupBindingConfigurationGet the fully qualified Java type name to use for collection items.When specified, the generated field and getter will use this type instead of
Objectfor the collection item type. This allows for type-safe collections when all choice alternatives share a common supertype.- Specified by:
getItemTypeNamein interfaceIChoiceGroupBindingConfiguration- Returns:
- the fully qualified Java type name, or
nullif not specified
-
isUseWildcard
public boolean isUseWildcard()Description copied from interface:IChoiceGroupBindingConfigurationDetermine whether to use a wildcard bounded type for the collection.When
true, generatesList<? extends Type>instead ofList<Type>. This provides additional flexibility when the exact item type may vary while still maintaining type safety.Defaults to
trueif an item type is specified.- Specified by:
isUseWildcardin interfaceIChoiceGroupBindingConfiguration- Returns:
trueto use wildcard bounds,falseotherwise
-