Interface IAssemblyDefinition

All Superinterfaces:
IAssembly, IAttributable, IContainer, IContainerModel, IContainerModelAbsolute, IContainerModelAssembly, IDefaultable, IDefinition, IDescribable, IFeatureModelConstrained, IFeatureValueConstrained, IJsonNamed, IModelConstrained, IModelDefinition, IModelElement, IModelElementVisitable, INamed, INamedModelElement, IValueConstrained
All Known Subinterfaces:
IBindingDefinitionModelAssembly, IBoundDefinitionModelAssembly
All Known Implementing Classes:
AbstractGlobalAssemblyDefinition, AbstractInlineAssemblyDefinition

public interface IAssemblyDefinition extends IModelDefinition, IContainerModelAssembly, IAssembly, IFeatureModelConstrained
Represents an assembly definition in a Metaschema module.

An assembly is a complex structured data object that may contain flags, fields, and other nested assemblies. Assembly definitions may be designated as root elements for documents.

  • Field Details

    • MODEL_QNAME

      static final IEnhancedQName MODEL_QNAME
      The qualified name for the model property in Metaschema.
  • Method Details

    • isRoot

      default boolean isRoot()
      Check if the assembly is a top-level root assembly.
      Returns:
      true if the assembly is a top-level root, or false otherwise
    • getRootName

      @Nullable default String getRootName()
      Get the root name if this assembly is a top-level root.
      Returns:
      the root name if this assembly is a top-level root, or null otherwise
    • getRootIndex

      @Nullable default Integer getRootIndex()
      Get the root index to use for binary data, if this assembly is a top-level root.
      Returns:
      the root index if provided and this assembly is a top-level root, or null otherwise
    • getRootQName

      default IEnhancedQName getRootQName()
      Get the XML qualified name to use in XML as the root element.
      Returns:
      the root XML qualified name if this assembly is a top-level root, or null otherwise
    • getRootJsonName

      default String getRootJsonName()
      Get the name used for the associated property in JSON/YAML.
      Returns:
      the root JSON property name if this assembly is a top-level root, or null otherwise
    • isInline

      default boolean isInline()
      Description copied from interface: IDefinition
      Determine if the definition is defined inline, meaning the definition is declared where it is used.

      If this method returns false, then IDefinition.getInlineInstance() must return null.

      Specified by:
      isInline in interface IDefinition
      Returns:
      true if the definition is declared inline or false if the definition is able to be globally referenced
      See Also:
    • getInlineInstance

      default IAssemblyInstance getInlineInstance()
      Description copied from interface: IDefinition
      If IDefinition.isInline() is true, return the instance the definition is inlined for.

      If this method returns null, then IDefinition.getInlineInstance() must return false.

      Specified by:
      getInlineInstance in interface IDefinition
      Returns:
      the instance or null otherwise
      See Also:
    • 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
    • hasChildren

      default boolean hasChildren()
      Description copied from interface: IContainer
      Identifies if the container allows child instances or not.

      This can be the case if the container has flags or a complex model with at least a choice, choice group, field, or assembly instance.

      Specified by:
      hasChildren in interface IContainer
      Specified by:
      hasChildren in interface IContainerModel
      Specified by:
      hasChildren in interface IModelDefinition
      Returns:
      true if there are flags or a model, or false otherwise
    • 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