Class AbstractNamedInstance<PARENT extends IContainer>

java.lang.Object
dev.metaschema.core.model.AbstractInstance<PARENT>
dev.metaschema.core.model.AbstractNamedInstance<PARENT>
Type Parameters:
PARENT - the Java type of the parent container
All Implemented Interfaces:
IAttributable, IDefaultable, IDescribable, IInstance, IJsonNamed, IModelElement, IModelElementVisitable, INamed, INamedInstance, INamedModelElement
Direct Known Subclasses:
AbstractFlagInstance, AbstractNamedModelInstance

public abstract class AbstractNamedInstance<PARENT extends IContainer> extends AbstractInstance<PARENT> implements INamedInstance
Base implementation of INamedInstance providing qualified name management.

This class lazily computes and caches both the instance's effective qualified name and its referenced definition qualified name.

  • Constructor Details

    • AbstractNamedInstance

      protected AbstractNamedInstance(@NonNull PARENT parent, @NonNull AbstractGlobalDefinition.NameInitializer initializer)
      Construct a new instance.
      Parameters:
      parent - the parent containing the instance
      initializer - used to generate the instance qualified name
  • Method Details

    • getQName

      public final IEnhancedQName getQName()
      Description copied from interface: INamed
      Get the unique XML qualified name for this model element.

      The qualified name is considered to be unique relative to all sibling elements. For a flag, this name will be unique among all flag instances on the same field or assembly definition. For a field or assembly, this name will be unique among all sibling field or assembly instances on the same assembly definition.

      Multiple calls to this method are expected to produce the same, deterministic return value.

      If the namespace is not specified, then the resulting QName will have the namespace XMLConstants.NULL_NS_URI.

      This implementation may be overridden by implementation that cache the QName or provide for a more efficient method for QName creation.

      Specified by:
      getQName in interface INamed
      Returns:
      the XML qualified name, or null if there isn't one
    • getReferencedDefinitionQName

      public final IEnhancedQName getReferencedDefinitionQName()
      Description copied from interface: INamedInstance
      This represents the qualified name of a referenced definition.
      Specified by:
      getReferencedDefinitionQName in interface INamedInstance
      Returns:
      the qualified name
      See Also: