- All Superinterfaces:
IDefaultable,IInstance,IModelElement,IModelElementVisitable
- All Known Subinterfaces:
IAssemblyInstance,IAssemblyInstanceAbsolute,IAssemblyInstanceGrouped,IBindingInstanceModel,IBoundInstanceModel<ITEM>,IBoundInstanceModelAssembly,IBoundInstanceModelChoiceGroup,IBoundInstanceModelField<ITEM>,IBoundInstanceModelFieldComplex,IBoundInstanceModelFieldScalar,IBoundInstanceModelGroupedAssembly,IBoundInstanceModelGroupedField,IBoundInstanceModelGroupedNamed,IBoundInstanceModelNamed<ITEM>,IChoiceGroupInstance,IChoiceInstance,IFieldInstance,IFieldInstanceAbsolute,IFieldInstanceGrouped,IModelInstance,IModelInstanceAbsolute,INamedModelInstance,INamedModelInstanceAbsolute,INamedModelInstanceGrouped
- All Known Implementing Classes:
AbstractAssemblyInstance,AbstractChoiceGroupInstance,AbstractChoiceInstance,AbstractFieldInstance,AbstractInlineAssemblyDefinition,AbstractInlineFieldDefinition,AbstractNamedModelInstance
This behavioral interface represents an instance that supports grouped
values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default Metaschema grouping maximum occurrence.static final intThe default Metaschema grouping minimum occurrence.static final JsonGroupAsBehaviorThe default Metaschema grouping behavior for JSON data.static final XmlGroupAsBehaviorThe default Metaschema grouping behavior for XML data. -
Method Summary
Modifier and TypeMethodDescriptiondefault IEnhancedQNameGet the name used for the associated element wrapping a collection of elements in XML.default StringGet the name provided for grouping.default Collection<?>getItemValues(Object instanceValue) Get the item values for the providedinstanceValue.default JsonGroupAsBehaviorGets the configured JSON group-as strategy.intGet the maximum cardinality for this associated instance.intGet the minimum cardinality for this associated instance.default XmlGroupAsBehaviorGets the configured XML group-as strategy.Methods inherited from interface dev.metaschema.core.model.IDefaultable
getDefaultValue, getEffectiveDefaultValue, getResolvedDefaultValueMethods inherited from interface dev.metaschema.core.model.IInstance
getContainingDefinition, getParentContainer, toCoordinatesMethods inherited from interface dev.metaschema.core.model.IModelElement
getContainingModule, getModelType, getRemarksMethods inherited from interface dev.metaschema.core.model.IModelElementVisitable
accept
-
Field Details
-
DEFAULT_GROUP_AS_MIN_OCCURS
static final int DEFAULT_GROUP_AS_MIN_OCCURSThe default Metaschema grouping minimum occurrence.- See Also:
-
DEFAULT_GROUP_AS_MAX_OCCURS
static final int DEFAULT_GROUP_AS_MAX_OCCURSThe default Metaschema grouping maximum occurrence.- See Also:
-
DEFAULT_JSON_GROUP_AS_BEHAVIOR
The default Metaschema grouping behavior for JSON data. -
DEFAULT_XML_GROUP_AS_BEHAVIOR
The default Metaschema grouping behavior for XML data.
-
-
Method Details
-
getMinOccurs
int getMinOccurs()Get the minimum cardinality for this associated instance. This value must be less than or equal to the maximum cardinality returned bygetMaxOccurs().- Returns:
0or a positive integer value- See Also:
-
getMaxOccurs
int getMaxOccurs()Get the maximum cardinality for this associated instance. This value must be greater than or equal to the minimum cardinality returned bygetMinOccurs(), or-1if unbounded.- Returns:
- a positive integer value or
-1if unbounded - See Also:
-
getGroupAsName
Get the name provided for grouping. An instance in Metaschema must have a group name if the instance has a cardinality greater than1.- Returns:
- the group-as name or
nullif no name is configured, such as whengetMaxOccurs()= 1
-
getEffectiveXmlGroupAsQName
Get the name used for the associated element wrapping a collection of elements in XML. This value is required whengetXmlGroupAsBehavior()=XmlGroupAsBehavior.GROUPED. This name will be the element name wrapping a collection of elements.If this instance doesn't have a namespace defined, then the module's XML namespace will be used.
- Returns:
- the groupAs QName or
nullif no name is configured, such as whengetMaxOccurs()= 1.
-
getJsonGroupAsBehavior
Gets the configured JSON group-as strategy. A JSON group-as strategy is only required whengetMaxOccurs()> 1.The default for this method is
JsonGroupAsBehavior.NONE, since the default behavior is to have no grouping. IfgetMaxOccurs()is greater than1, then the default behavior is#DEFAULT_JSON_GROUP_AS_BEHAVIOR.- Returns:
- the JSON group-as strategy, or
JsonGroupAsBehavior#NONEifgetMaxOccurs()= 1 - See Also:
-
getXmlGroupAsBehavior
Gets the configured XML group-as strategy. A XML group-as strategy is only required whengetMaxOccurs()> 1.- Returns:
- the JSON group-as strategy, or
XmlGroupAsBehavior#UNGROUPEDifgetMaxOccurs()= 1 - See Also:
-
getItemValues
Get the item values for the providedinstanceValue. An instance may be singular or many valued.- Parameters:
instanceValue- the instance- Returns:
- the item values or an empty collection if no item values exist
-