Class AbstractChoiceInstance
- java.lang.Object
-
- gov.nist.secauto.metaschema.core.model.AbstractInstance<IModelContainer>
-
- gov.nist.secauto.metaschema.core.model.AbstractModelInstance
-
- gov.nist.secauto.metaschema.core.model.AbstractChoiceInstance
-
- All Implemented Interfaces:
IChoiceInstance
,IContainer
,IInstance
,IModelContainer
,IModelElement
,IModelInstance
public abstract class AbstractChoiceInstance extends AbstractModelInstance implements IChoiceInstance
-
-
Constructor Summary
Constructors Constructor Description AbstractChoiceInstance(IModelContainer parent)
Create a new choice instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.XmlGroupAsBehavior
getXmlGroupAsBehavior()
Gets the configured XML group-as strategy.-
Methods inherited from class gov.nist.secauto.metaschema.core.model.AbstractModelInstance
getContainingDefinition
-
Methods inherited from class gov.nist.secauto.metaschema.core.model.AbstractInstance
getParentContainer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IChoiceInstance
getModelType, getOwningDefinition, getParentContainer
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IInstance
getContainingModule, toCoordinates
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IModelContainer
getAssemblyInstanceByName, getAssemblyInstances, getChoiceInstances, getFieldInstanceByName, getFieldInstances, getModelInstanceByName, getModelInstances, getNamedModelInstances
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IModelElement
getRemarks
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IModelInstance
getContainingDefinition, getXmlGroupAsQName
-
-
-
-
Constructor Detail
-
AbstractChoiceInstance
public AbstractChoiceInstance(@NonNull IModelContainer parent)
Create a new choice instance.- Parameters:
parent
- the containing assembly definition
-
-
Method Detail
-
getMinOccurs
public int getMinOccurs()
Description copied from interface:IModelInstance
Get the minimum cardinality for this associated instance. This value must be less than or equal to the maximum cardinality returned byIModelInstance.getMaxOccurs()
.- Specified by:
getMinOccurs
in interfaceIModelInstance
- Returns:
0
or a positive integer value
-
getMaxOccurs
public int getMaxOccurs()
Description copied from interface:IModelInstance
Get the maximum cardinality for this associated instance. This value must be greater than or equal to the minimum cardinality returned byIModelInstance.getMinOccurs()
, or-1
if unbounded.- Specified by:
getMaxOccurs
in interfaceIModelInstance
- Returns:
- a positive integer value or
-1
if unbounded
-
getGroupAsName
public String getGroupAsName()
Description copied from interface:IModelInstance
Get the name provided for grouping. An instance in Metaschema must have a group name if the instance has a cardinality greater than1
.- Specified by:
getGroupAsName
in interfaceIModelInstance
- Returns:
- the group-as name or
null
if no name is configured, such as whenIModelInstance.getMaxOccurs()
= 1
-
getGroupAsXmlNamespace
public String getGroupAsXmlNamespace()
Description copied from interface:IModelInstance
Retrieve the XML namespace for this group.- Specified by:
getGroupAsXmlNamespace
in interfaceIModelInstance
- Returns:
- the XML namespace or
null
if no namespace is used
-
getJsonGroupAsBehavior
public JsonGroupAsBehavior getJsonGroupAsBehavior()
Description copied from interface:IModelInstance
Gets the configured JSON group-as strategy. A JSON group-as strategy is only required whenIModelInstance.getMaxOccurs()
> 1.- Specified by:
getJsonGroupAsBehavior
in interfaceIModelInstance
- Returns:
- the JSON group-as strategy, or
JsonGroupAsBehavior#NONE
ifIModelInstance.getMaxOccurs()
= 1
-
getXmlGroupAsBehavior
public XmlGroupAsBehavior getXmlGroupAsBehavior()
Description copied from interface:IModelInstance
Gets the configured XML group-as strategy. A XML group-as strategy is only required whenIModelInstance.getMaxOccurs()
> 1.- Specified by:
getXmlGroupAsBehavior
in interfaceIModelInstance
- Returns:
- the JSON group-as strategy, or
XmlGroupAsBehavior#UNGROUPED
ifIModelInstance.getMaxOccurs()
= 1
-
-