Interface IDefinition

All Superinterfaces:
IAttributable, IDefaultable, IDescribable, IFeatureValueConstrained, IJsonNamed, IModelElement, IModelElementVisitable, INamed, INamedModelElement, IValueConstrained
All Known Subinterfaces:
IAssemblyDefinition, IBindingDefinitionModel, IBindingDefinitionModelAssembly, IBoundDefinition, IBoundDefinitionFlag, IBoundDefinitionModel<ITEM>, IBoundDefinitionModelAssembly, IBoundDefinitionModelComplex, IBoundDefinitionModelField<ITEM>, IBoundDefinitionModelFieldComplex, IBoundInstanceFlag, IBoundInstanceModelFieldScalar, IFeatureContainerFlag<FI>, IFeatureDefinitionInstanceInlined<DEFINITION,INSTANCE>, IFieldDefinition, IFlagDefinition, IModelDefinition, IValuedDefinition
All Known Implementing Classes:
AbstractGlobalAssemblyDefinition, AbstractGlobalDefinition, AbstractGlobalFieldDefinition, AbstractGlobalFlagDefinition, AbstractInlineAssemblyDefinition, AbstractInlineFieldDefinition, AbstractInlineFlagDefinition

public interface IDefinition extends INamedModelElement, IAttributable, IFeatureValueConstrained
Represents a definition of a flag, field, or assembly in a Metaschema module.

Definitions are reusable components that specify the structure and constraints for data elements. They can be referenced by instances or defined inline.

  • Field Details

    • DEFAULT_MODULE_SCOPE

      @NonNull static final IDefinition.ModuleScope DEFAULT_MODULE_SCOPE
      The default module scope for definitions.
  • Method Details

    • getModuleScope

      @NonNull default IDefinition.ModuleScope getModuleScope()
      Retrieve the definition's scope within the context of its defining module.
      Returns:
      the module scope
    • getDefinitionQName

      @NonNull IEnhancedQName getDefinitionQName()
      The qualified name for the definition.

      This name is the combination of the definition's namespace, which is the module's namespace, and the definition's name.

      Returns:
      the definition's qualified name
    • isInline

      default boolean isInline()
      Determine if the definition is defined inline, meaning the definition is declared where it is used.

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

      Returns:
      true if the definition is declared inline or false if the definition is able to be globally referenced
      See Also:
    • getInlineInstance

      INamedInstance getInlineInstance()
      If isInline() is true, return the instance the definition is inlined for.

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

      Returns:
      the instance or null otherwise
      See Also:
    • toCoordinates

      default String toCoordinates()
      Generates a coordinate string for the provided information element definition. A coordinate consists of the element's:
      • containing Metaschema's short name
      • model type
      • name
      • hash code
      Specified by:
      toCoordinates in interface IModelElement
      Returns:
      the coordinate
    • getLocation

      @Nullable default IResourceLocation getLocation(@NonNull Object itemValue)
      Get the resource location information for the provided item, if known.
      Parameters:
      itemValue - the item to get the location information for
      Returns:
      the resource location information, or null if not known