Class Namespace

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

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

    • Namespace

      protected Namespace(Namespace.NamespaceBuilder<?,?> b)
    • Namespace

      public Namespace()
    • Namespace

      public Namespace(Version version, String prefix, String name, String uri, String definition, Namespace.Category category, String draft, Namespace.NdrTarget target, Namespace.Generation generation, String filename, String filepath, Set<Type> types, Set<Property> properties)
      Creates a new Namespace instance.
      Parameters:
      version - Model version in which this entity is defined.
      prefix - A short, non-normative identifier for a namespace.
      name - A name of a namespace.
      uri - A normative identifier for a namespace.
      definition - A definition that describes a namespace.
      category - A kind of namespace.
      draft - A draft version of a namespace. NIEM conventions are to use the value "1" for a namespace that has reached release candidate status or has been published.
      target - A code representing an NDR conformance target, or null if the namespace is not meant to be conformant.
      generation - A means by which a namespace should be generated.
      • build: Generate by assembling its properties and types
      • static_file: Include it's pre-built file (e.g., externals and utilities)
      • none: Namespace may be referenced but does not need to be included (e.g., XML Schema)
      Defaults to "build".
      filename - The filename to use for representations of this namespace such as XML schemas, without a file extension.
      filepath - The filepath to use for nested representations of this namespace such as for XML schemas, without the filename or extension.
      types -
      properties -
  • Method Details

    • 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
    • getFullIdentifier

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

      public String getLocalIdentifier()
      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:
      getLocalIdentifier 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 void addToCmfModel(org.mitre.niem.cmf.Model cmfModel) throws org.mitre.niem.cmf.CMFException
      Adds this namespace to the given CMF model.
      Specified by:
      addToCmfModel in interface BaseCmfEntity<org.mitre.niem.cmf.Namespace>
      Throws:
      org.mitre.niem.cmf.CMFException
    • 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.
    • categoryToCmf

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

      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_BUILTIN = 4; appinfo, code-lists, conformance, proxy, structures NSK_XSD = 5; namespace for XSD datatypes NSK_XML = 6; namespace for xml: attributes NSK_EXTERNAL = 7; imported with appinfo:externalImportIndicator NSK_UNKNOWN = 8; no conformance assertion; not any of the above NSK_NUMKINDS = 9; this many kinds of namespaces

    • builder

      public static Namespace.NamespaceBuilder<?,?> builder()
    • getPrefix

      public String getPrefix()
      A short, non-normative identifier for a namespace.
    • getName

      public String getName()
      A name of a namespace.
    • getUri

      public String getUri()
      A normative identifier for a namespace.
    • getDefinition

      public String getDefinition()
      A definition that describes a namespace.
    • getCategory

      public Namespace.Category getCategory()
      A kind of namespace.
    • getDraft

      public String getDraft()
      A draft version of a namespace. NIEM conventions are to use the value "1" for a namespace that has reached release candidate status or has been published.
    • getTarget

      public Namespace.NdrTarget getTarget()
      A code representing an NDR conformance target, or null if the namespace is not meant to be conformant.
    • getGeneration

      public Namespace.Generation getGeneration()
      A means by which a namespace should be generated.
      • build: Generate by assembling its properties and types
      • static_file: Include it's pre-built file (e.g., externals and utilities)
      • none: Namespace may be referenced but does not need to be included (e.g., XML Schema)
      Defaults to "build".
    • getFilename

      public String getFilename()
      The filename to use for representations of this namespace such as XML schemas, without a file extension.
    • getFilepath

      public String getFilepath()
      The filepath to use for nested representations of this namespace such as for XML schemas, without the filename or extension.
    • getTypes

      public Set<Type> getTypes()
    • getProperties

      public Set<Property> getProperties()
    • setVersion

      public void setVersion(Version version)
      Model version in which this entity is defined.
    • setPrefix

      public void setPrefix(String prefix)
      A short, non-normative identifier for a namespace.
    • setName

      public void setName(String name)
      A name of a namespace.
    • setUri

      public void setUri(String uri)
      A normative identifier for a namespace.
    • setDefinition

      public void setDefinition(String definition)
      A definition that describes a namespace.
    • setCategory

      public void setCategory(Namespace.Category category)
      A kind of namespace.
    • setDraft

      public void setDraft(String draft)
      A draft version of a namespace. NIEM conventions are to use the value "1" for a namespace that has reached release candidate status or has been published.
    • setTarget

      public void setTarget(Namespace.NdrTarget target)
      A code representing an NDR conformance target, or null if the namespace is not meant to be conformant.
    • setGeneration

      public void setGeneration(Namespace.Generation generation)
      A means by which a namespace should be generated.
      • build: Generate by assembling its properties and types
      • static_file: Include it's pre-built file (e.g., externals and utilities)
      • none: Namespace may be referenced but does not need to be included (e.g., XML Schema)
      Defaults to "build".
    • setFilename

      public void setFilename(String filename)
      The filename to use for representations of this namespace such as XML schemas, without a file extension.
    • setFilepath

      public void setFilepath(String filepath)
      The filepath to use for nested representations of this namespace such as for XML schemas, without the filename or extension.
    • setTypes

      public void setTypes(Set<Type> types)
    • setProperties

      public void setProperties(Set<Property> properties)
    • toString

      public String toString()
      Overrides:
      toString in class BaseVersionEntity<Namespace>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class BaseVersionEntity<Namespace>
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class BaseVersionEntity<Namespace>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BaseVersionEntity<Namespace>