Interface IChoiceInstance

All Superinterfaces:
IContainer, IContainerModel, IContainerModelAbsolute, IDefaultable, IGroupable, IInstance, IInstanceAbsolute, IModelElement, IModelElementVisitable, IModelInstance, IModelInstanceAbsolute, IValued
All Known Implementing Classes:
AbstractChoiceInstance

public interface IChoiceInstance extends IModelInstanceAbsolute, IContainerModelAbsolute
A marker interface for a choice of allowed instances in a Metachema.
  • Method Details

    • getModelType

      default ModelType getModelType()
      Provides the Metaschema model type of "CHOICE".
      Specified by:
      getModelType in interface IModelElement
      Returns:
      the model type
    • getOwningDefinition

      default IAssemblyDefinition getOwningDefinition()
      Description copied from interface: IContainerModel
      Retrieve the Metaschema module definition containing this container.
      Specified by:
      getOwningDefinition in interface IContainerModel
      Returns:
      the containing Metaschema module definition
    • getMinOccurs

      default int getMinOccurs()
      Description copied from interface: IGroupable
      Get the minimum cardinality for this associated instance. This value must be less than or equal to the maximum cardinality returned by IGroupable.getMaxOccurs().
      Specified by:
      getMinOccurs in interface IGroupable
      Returns:
      0 or a positive integer value
      See Also:
    • getMaxOccurs

      default int getMaxOccurs()
      Description copied from interface: IGroupable
      Get the maximum cardinality for this associated instance. This value must be greater than or equal to the minimum cardinality returned by IGroupable.getMinOccurs(), or -1 if unbounded.
      Specified by:
      getMaxOccurs in interface IGroupable
      Returns:
      a positive integer value or -1 if unbounded
      See Also:
    • getEffectiveXmlGroupAsQName

      default IEnhancedQName getEffectiveXmlGroupAsQName()
      Description copied from interface: IGroupable
      Get the name used for the associated element wrapping a collection of elements in XML. This value is required when IGroupable.getXmlGroupAsBehavior() = 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.

      Specified by:
      getEffectiveXmlGroupAsQName in interface IGroupable
      Returns:
      the groupAs QName or null if no name is configured, such as when IGroupable.getMaxOccurs() = 1.
    • isEffectiveValueWrappedInXml

      default boolean isEffectiveValueWrappedInXml()
      Description copied from interface: IModelInstance
      Indicate if the instance allows values without an XML element wrapper.
      Specified by:
      isEffectiveValueWrappedInXml in interface IModelInstance
      Returns:
      true if the underlying data type is allowed to be unwrapped, or false otherwise
    • toCoordinates

      default String toCoordinates()
      Description copied from interface: IInstance
      Generates 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:
      toCoordinates in interface IInstance
      Specified by:
      toCoordinates in interface IModelElement
      Returns:
      the coordinate
    • accept

      default <CONTEXT, RESULT> RESULT accept(@NonNull IModelElementVisitor<CONTEXT,RESULT> visitor, CONTEXT context)
      A visitor callback.
      Specified by:
      accept in interface IModelElementVisitable
      Type Parameters:
      CONTEXT - the type of the context parameter
      RESULT - the type of the visitor result
      Parameters:
      visitor - the calling visitor
      context - a parameter used to pass contextual information between visitors
      Returns:
      the visitor result