1 /* 2 * SPDX-FileCopyrightText: none 3 * SPDX-License-Identifier: CC0-1.0 4 */ 5 6 package gov.nist.secauto.metaschema.core.model; 7 8 import edu.umd.cs.findbugs.annotations.NonNull; 9 10 /** 11 * This marker interface indicates that this object is an instance. 12 */ 13 public interface IInstance extends IModelElement { 14 15 /** 16 * Retrieve the Metaschema module definition on which the instance was declared. 17 * 18 * @return the Metaschema module definition on which the instance was declared 19 */ 20 @NonNull 21 IModelDefinition getContainingDefinition(); 22 23 /** 24 * Get the parent model definition that serves as the container of this 25 * instance. 26 * 27 * @return the container 28 */ 29 @NonNull 30 IContainer getParentContainer(); 31 32 // @Override 33 // default IModule getContainingModule() { 34 // return getContainingDefinition().getContainingModule(); 35 // } 36 37 /** 38 * Generates a "coordinate" string for the provided information element 39 * instance. 40 * 41 * A coordinate consists of the element's: 42 * <ul> 43 * <li>containing Metaschema module's short name</li> 44 * <li>model type</li> 45 * <li>name</li> 46 * <li>hash code</li> 47 * <li>the hash code of the definition</li> 48 * </ul> 49 * 50 * @return the coordinate 51 */ 52 @Override 53 String toCoordinates(); 54 }