001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package dev.metaschema.core.model;
007
008import edu.umd.cs.findbugs.annotations.NonNull;
009
010/**
011 * This marker interface indicates that this object is an instance.
012 */
013public interface IInstance extends IModelElement {
014
015  /**
016   * Retrieve the Metaschema module definition on which the instance was declared.
017   *
018   * @return the Metaschema module definition on which the instance was declared
019   */
020  @NonNull
021  IModelDefinition getContainingDefinition();
022
023  /**
024   * Get the parent model definition that serves as the container of this
025   * instance.
026   *
027   * @return the container
028   */
029  @NonNull
030  IContainer getParentContainer();
031
032  // @Override
033  // default IModule getContainingModule() {
034  // return getContainingDefinition().getContainingModule();
035  // }
036
037  /**
038   * Generates a "coordinate" string for the provided information element
039   * instance.
040   *
041   * A coordinate consists of the element's:
042   * <ul>
043   * <li>containing Metaschema module's short name
044   * <li>model type
045   * <li>name
046   * <li>hash code
047   * <li>the hash code of the definition
048   * </ul>
049   *
050   * @return the coordinate
051   */
052  @Override
053  String toCoordinates();
054}