Class Namespace

All Implemented Interfaces:
BaseCmfEntity<org.mitre.niem.cmf.Namespace>, Serializable, Comparable<Namespace>

@Entity @Indexed public class Namespace extends BaseVersionEntity<Namespace> implements BaseCmfEntity<org.mitre.niem.cmf.Namespace>, Comparable<Namespace>
A collection of properties and types managed by an authoritative source.
See Also:
  • Constructor Details

    • Namespace

      public Namespace()
  • Method Details

    • getRank

      @IndexingDependency(derivedFrom=@ObjectPath(@PropertyValue(propertyName="category"))) @GenericField(sortable=YES) public int getRank()
      A ranking used to support sorting namespaces by category, with Core and Core Supplements sorting first, followed by domains, etc.
    • getVersion

      public Version getVersion()
      Gets the version to which this namespace belongs.
      Specified by:
      getVersion in class BaseVersionEntity<Namespace>
    • hasTarget

      public boolean hasTarget()
      True if the namespace has a NDR conformance target and is meant to be conforming; false if the namespace is a utility, external, or is otherwise not meant to be conforming.
    • getParentEntity

      public Version getParentEntity()
      Description copied from class: BaseEntity
      An immediate entity or scope to which this entity belongs. Examples include a steward (parent) for a model or a namespace (parent) for a property or type.
      Specified by:
      getParentEntity in class BaseEntity
    • getRoute

      public String getRoute()
      Description copied from class: BaseEntity
      An endpoint to get information about an entity.
      Specified by:
      getRoute in class BaseEntity
    • getClassName

      public String getClassName()
      Description copied from class: BaseEntity
      A kind of NIEM entity, such as a Namespace or a Property.
      Overrides:
      getClassName in class BaseEntity
    • getIdLabel

      public String getIdLabel()
      Description copied from class: BaseEntity
      A human-readable and url-friendly unique identifier for an entity.
      Specified by:
      getIdLabel in class BaseEntity
    • getIdLocalLabel

      public String getIdLocalLabel()
      Description copied from class: BaseEntity
      An identifier, unique within its immediate scope. Examples include a prefix (uniquely identifying a namespace) or a qualified name (uniquely identifying a property or a type) within a version of a model.
      Specified by:
      getIdLocalLabel in class BaseEntity
    • getTitle

      public String getTitle()
      Description copied from class: BaseEntity
      A descriptive label or title used to identify an entity.
      Specified by:
      getTitle in class BaseEntity
    • getConformanceTargetName

      public String getConformanceTargetName()
      Returns the name of the conformance target. For example, for a REF target, returns "Reference".
    • getNiemVersionMajorDigit

      public Integer getNiemVersionMajorDigit()
      Returns the first digit of the NIEM version compatible with this namespace.
    • getNdrVersion

      public String getNdrVersion()
      Gets the NDR version for this namespace, based on the version of NIEM that is compatible with this namespace.
    • getNdrConformanceTarget

      public String getNdrConformanceTarget()
      Gets the conformance target URI based on the target and NIEM version number of this namespace.
    • toSummary

      public Map<String,String> toSummary()
      Gets key fields about a namespace.
    • addToCmfModel

      public org.mitre.niem.cmf.Namespace addToCmfModel(org.mitre.niem.cmf.Model cmfModel, boolean addDependencies, AddModelReason addModelReason, Test test) throws org.mitre.niem.cmf.CMFException, EntityNotUniqueException
      Adds this namespace to the given CMF model if it does not already exist.
      Specified by:
      addToCmfModel in interface BaseCmfEntity<org.mitre.niem.cmf.Namespace>
      Parameters:
      cmfModel - The CMF model.
      addDependencies - True to also add namespace dependencies (local terminology); false to just add this namespace.
      addModelReason - Indicates the reason why a component is being added to the model, either directly due to a task like migration or transformation, or indirectly as a required dependency.
      test - If present, log info to given test object.
      Throws:
      org.mitre.niem.cmf.CMFException
      EntityNotUniqueException
    • toCmf

      public org.mitre.niem.cmf.Namespace toCmf() throws org.mitre.niem.cmf.CMFException
      Converts this namespace to a CMF namespace object.
      Specified by:
      toCmf in interface BaseCmfEntity<org.mitre.niem.cmf.Namespace>
      Throws:
      org.mitre.niem.cmf.CMFException
    • categoryFromCmf

      public Namespace.Category categoryFromCmf(int kind)
      Converts CMF namespace categories to API namespace categories.
    • categoryToCmfInt

      public int categoryToCmfInt(Namespace.Category category)
      Converts API namespace categories to CMF namespace kinds (int).

      From CMF: cmf/NamespaceKind.java NSK_EXTENSION = 0; has conformance assertion, not in NIEM model NSK_DOMAIN = 1; domain schema NSK_CORE = 2; niem core schema NSK_OTHERNIEM = 3; other niem model; starts with release or publication prefix NSK_APPINFO = 4; appinfo NSK_CLSA = 5; code lists schema appinfo NSK_CLI = 6; code lists instance NSK_NIEM_XS = 7; proxy NSK_STRUCTURES = 8; structures NSK_XSD = 9; namespace for XSD NSK_XML = 10; namespace for xml: attributes NSK_EXTERNAL = 11; was imported with appinfo:externalImportIndicator NSK_NOTNIEM = 12; none of the above; no conformance assertion or external appinfo NSK_UNKNOWN = 13; can't figure it out; probably an error NSK_NUMKINDS = 14; this many kinds of namespaces

    • categoryToCmfString

      public String categoryToCmfString(Namespace.Category category)
      Converts API namespace categories to CMF namespace kinds (string).
    • compareTo

      public int compareTo(Namespace other)
      Custom sorting function for namespaces. Sorts by namespace rank, then prefix.
      Specified by:
      compareTo in interface Comparable<Namespace>