Interface IAnyInstance

All Superinterfaces:
IDefaultable, IGroupable, IInstance, IInstanceAbsolute, IModelElement, IModelElementVisitable, IModelInstance, IModelInstanceAbsolute, IValued
All Known Subinterfaces:
IBoundInstanceModelAny

public interface IAnyInstance extends IModelInstanceAbsolute
A marker interface for an any instance in a Metaschema model.

An any instance represents unmodeled content that may appear within an assembly's model. Unlike other model instances, an any instance does not have a definition or name; it acts as a wildcard that captures content not explicitly declared by the model.

An any instance is always optional (getMinOccurs() returns 0) and unbounded (getMaxOccurs() returns -1).

  • Method Details

    • getModelType

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

      default IAssemblyDefinition getContainingDefinition()
      Description copied from interface: IInstance
      Retrieve the Metaschema module definition on which the instance was declared.
      Specified by:
      getContainingDefinition in interface IInstance
      Specified by:
      getContainingDefinition in interface IModelInstance
      Returns:
      the Metaschema module definition on which the instance was declared
    • 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