- All Superinterfaces:
IContainer,IContainerModel,IContainerModelGrouped,IDefaultable,IGroupable,IInstance,IInstanceAbsolute,IJsonInstance,IModelElement,IModelElementVisitable,IModelInstance,IModelInstanceAbsolute,IValued
- All Known Subinterfaces:
IBoundInstanceModelChoiceGroup
- All Known Implementing Classes:
AbstractChoiceGroupInstance
public interface IChoiceGroupInstance
extends IModelInstanceAbsolute, IContainerModelGrouped, IJsonInstance
An Metaschema model instance representing a grouped set of objects consisting
of heterogeneous object types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default max-occurs value for a choice group.static final StringThe default JSON property value used to identify the specific type of the object.Fields inherited from interface dev.metaschema.core.model.IGroupable
DEFAULT_GROUP_AS_MAX_OCCURS, DEFAULT_GROUP_AS_MIN_OCCURS, DEFAULT_JSON_GROUP_AS_BEHAVIOR, DEFAULT_XML_GROUP_AS_BEHAVIOR -
Method Summary
Modifier and TypeMethodDescriptiondefault <CONTEXT,RESULT>
RESULTaccept(IModelElementVisitor<CONTEXT, RESULT> visitor, CONTEXT context) A visitor callback.default INamedModelInstanceGroupedgetItemInstance(Object item) Get the named model instance for the provided choice group item.Get the JSON property to use to discriminate between JSON objects.Get the effective name of the JSON key flag, if a JSON key is configured.default StringGet the name used for the instance in JSON/YAML serialization.default intGet the maximum cardinality for this associated instance.default ModelTypeProvides the Metaschema model type of "CHOICE".default MarkupMultilineRetrieve the remarks associated with this information element, if any.default booleanIndicate if the instance allows values without an XML element wrapper.default StringGenerates a "coordinate" string for the provided information element instance.Methods inherited from interface dev.metaschema.core.model.IContainerModel
hasChildrenMethods inherited from interface dev.metaschema.core.model.IContainerModelGrouped
getAssemblyInstanceByName, getAssemblyInstances, getFieldInstanceByName, getFieldInstances, getModelInstances, getNamedModelInstanceByName, getNamedModelInstances, getOwningDefinitionMethods inherited from interface dev.metaschema.core.model.IDefaultable
getDefaultValue, getEffectiveDefaultValue, getResolvedDefaultValueMethods inherited from interface dev.metaschema.core.model.IGroupable
getEffectiveXmlGroupAsQName, getGroupAsName, getItemValues, getJsonGroupAsBehavior, getMinOccurs, getXmlGroupAsBehaviorMethods inherited from interface dev.metaschema.core.model.IModelElement
getContainingModuleMethods inherited from interface dev.metaschema.core.model.IModelInstance
getContainingDefinition, getParentContainer
-
Field Details
-
DEFAULT_CHOICE_GROUP_GROUP_AS_MAX_OCCURS
static final int DEFAULT_CHOICE_GROUP_GROUP_AS_MAX_OCCURSThe default max-occurs value for a choice group.-1represents an unbounded occurance.- See Also:
-
DEFAULT_JSON_DISCRIMINATOR_PROPERTY_NAME
The default JSON property value used to identify the specific type of the object.- See Also:
-
-
Method Details
-
getMaxOccurs
default int getMaxOccurs()Get the maximum cardinality for this associated instance. This value must be greater than or equal to the minimum cardinality returned byIGroupable.getMinOccurs(), or-1if unbounded.- Specified by:
getMaxOccursin interfaceIGroupable- Returns:
- a positive integer value or
-1if unbounded - See Also:
-
getModelType
Provides the Metaschema model type of "CHOICE".- Specified by:
getModelTypein interfaceIModelElement- Returns:
- the model type
-
getJsonName
Description copied from interface:IJsonInstanceGet the name used for the instance in JSON/YAML serialization.- Specified by:
getJsonNamein interfaceIJsonInstance- Returns:
- the JSON property name
-
getJsonDiscriminatorProperty
Get the JSON property to use to discriminate between JSON objects.- Returns:
- the discriminator property
- See Also:
-
isEffectiveValueWrappedInXml
default boolean isEffectiveValueWrappedInXml()Description copied from interface:IModelInstanceIndicate if the instance allows values without an XML element wrapper.- Specified by:
isEffectiveValueWrappedInXmlin interfaceIModelInstance- Returns:
trueif the underlying data type is allowed to be unwrapped, orfalseotherwise
-
getJsonKeyFlagInstanceName
Get the effective name of the JSON key flag, if a JSON key is configured.This name is expected to be in the same namespace as the containing model element (i.e. choice group, assembly, field).
- Returns:
- the name of the JSON key flag if configured, or
nullotherwise
-
getItemInstance
Get the named model instance for the provided choice group item.- Parameters:
item- the item to get the instance for- Returns:
- the named model instance for the provided choice group item
-
getRemarks
Description copied from interface:IModelElementRetrieve the remarks associated with this information element, if any.- Specified by:
getRemarksin interfaceIModelElement- Returns:
- the remarks or
nullif no remarks are defined
-
toCoordinates
Description copied from interface:IInstanceGenerates a "coordinate" string for the provided information element instance. A coordinate consists of the element's:- containing Metaschema module's short name
- model type
- name
- hash code
- the hash code of the definition
- Specified by:
toCoordinatesin interfaceIInstance- Specified by:
toCoordinatesin interfaceIModelElement- Returns:
- the coordinate
-
accept
default <CONTEXT,RESULT> RESULT accept(@NonNull IModelElementVisitor<CONTEXT, RESULT> visitor, CONTEXT context) A visitor callback.- Specified by:
acceptin interfaceIModelElementVisitable- Type Parameters:
CONTEXT- the type of the context parameterRESULT- the type of the visitor result- Parameters:
visitor- the calling visitorcontext- a parameter used to pass contextual information between visitors- Returns:
- the visitor result
-