Interface IModelInstance
-
- All Superinterfaces:
IInstance
,IModelElement
- All Known Subinterfaces:
IAssemblyInstance
,IChoiceInstance
,IFieldInstance
,INamedModelInstance
- All Known Implementing Classes:
AbstractAssemblyInstance
,AbstractChoiceInstance
,AbstractFieldInstance
,AbstractModelInstance
public interface IModelInstance extends IInstance
This marker interface is used to identify a field or assembly instance that is a member of an assembly's model.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description IAssemblyDefinition
getContainingDefinition()
Retrieve the Metaschema assembly definition on which this instance is declared.String
getGroupAsName()
Get the name provided for grouping.String
getGroupAsXmlNamespace()
Retrieve the XML namespace for this group.JsonGroupAsBehavior
getJsonGroupAsBehavior()
Gets the configured JSON group-as strategy.int
getMaxOccurs()
Get the maximum cardinality for this associated instance.int
getMinOccurs()
Get the minimum cardinality for this associated instance.IModelContainer
getParentContainer()
Get the parent model definition that serves as the container of this instance.XmlGroupAsBehavior
getXmlGroupAsBehavior()
Gets the configured XML group-as strategy.default QName
getXmlGroupAsQName()
Get the name used for the associated element wrapping a collection of elements in XML.-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IInstance
getContainingModule, toCoordinates
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IModelElement
getModelType, getRemarks
-
-
-
-
Method Detail
-
getParentContainer
IModelContainer getParentContainer()
Description copied from interface:IInstance
Get the parent model definition that serves as the container of this instance.- Specified by:
getParentContainer
in interfaceIInstance
- Returns:
- the container
-
getContainingDefinition
IAssemblyDefinition getContainingDefinition()
Retrieve the Metaschema assembly definition on which this instance is declared.- Specified by:
getContainingDefinition
in interfaceIInstance
- Returns:
- the parent Metaschema assembly definition
-
getXmlGroupAsQName
@Nullable default QName getXmlGroupAsQName()
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.- Returns:
- the groupAs QName or
null
if no name is configured, such as whengetMaxOccurs()
= 1.
-
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:
0
or a positive integer value
-
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-1
if unbounded.- Returns:
- a positive integer value or
-1
if unbounded
-
getGroupAsName
@Nullable String 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
null
if no name is configured, such as whengetMaxOccurs()
= 1
-
getGroupAsXmlNamespace
@Nullable String getGroupAsXmlNamespace()
Retrieve the XML namespace for this group.- Returns:
- the XML namespace or
null
if no namespace is used
-
getJsonGroupAsBehavior
@NonNull JsonGroupAsBehavior getJsonGroupAsBehavior()
Gets the configured JSON group-as strategy. A JSON group-as strategy is only required whengetMaxOccurs()
> 1.- Returns:
- the JSON group-as strategy, or
JsonGroupAsBehavior#NONE
ifgetMaxOccurs()
= 1
-
getXmlGroupAsBehavior
@NonNull XmlGroupAsBehavior 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#UNGROUPED
ifgetMaxOccurs()
= 1
-
-