Package gov.niem.tools.api.db.namespace
Class Namespace
java.lang.Object
- 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Kinds of namespaces, such as core, domain, code, adapter, and extension.static enum
Kinds of schema generation options, representing schemas that have to be built, schemas that are to be included as static files, and schemas that do not have to be included at all (e.g., the schema for XML Schema).static class
Namespace.NamespaceBuilder<C extends Namespace,
B extends Namespace.NamespaceBuilder<C, B>> static enum
Kinds of NDR targets, such as REF and EXT.Nested classes/interfaces inherited from class gov.niem.tools.api.db.base.BaseVersionEntity
BaseVersionEntity.BaseVersionEntityBuilder<T extends BaseVersionEntity<T>,
C extends BaseVersionEntity<T>, B extends BaseVersionEntity.BaseVersionEntityBuilder<T, C, B>> Nested classes/interfaces inherited from class gov.niem.tools.api.db.base.BaseModelEntity
BaseModelEntity.BaseModelEntityBuilder<C extends BaseModelEntity,
B extends BaseModelEntity.BaseModelEntityBuilder<C, B>> Nested classes/interfaces inherited from class gov.niem.tools.api.db.base.BaseStewardEntity
BaseStewardEntity.BaseStewardEntityBuilder<C extends BaseStewardEntity,
B extends BaseStewardEntity.BaseStewardEntityBuilder<C, B>> Nested classes/interfaces inherited from class gov.niem.tools.api.db.base.BaseEntity
BaseEntity.BaseEntityBuilder<C extends BaseEntity,
B extends BaseEntity.BaseEntityBuilder<C, B>> -
Field Summary
Fields inherited from class gov.niem.tools.api.db.base.BaseVersionEntity
next, prev
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Namespace
(Namespace.NamespaceBuilder<?, ?> b) 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 newNamespace
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToCmfModel
(org.mitre.niem.cmf.Model cmfModel) Adds this namespace to the given CMF model.static Namespace.NamespaceBuilder
<?, ?> builder()
protected boolean
categoryFromCmf
(int kind) Converts CMF namespace categories to API namespace categories.int
categoryToCmf
(Namespace.Category category) Converts API namespace categories to CMF namespace categories.boolean
A kind of namespace.A kind of NIEM entity, such as a Namespace or a Property.Returns the name of the conformance target.A definition that describes a namespace.getDraft()
A draft version of a namespace.The filename to use for representations of this namespace such as XML schemas, without a file extension.The filepath to use for nested representations of this namespace such as for XML schemas, without the filename or extension.A human-readable and url-friendly unique identifier for an entity.A means by which a namespace should be generated.An identifier, unique within its immediate scope.getName()
A name of a namespace.Gets the conformance target URI based on the target and NIEM version number of this namespace.Gets the NDR version for this namespace, based on the version of NIEM that is compatible with this namespace.Returns the first digit of the NIEM version compatible with this namespace.An immediate entity or scope to which this entity belongs.A short, non-normative identifier for a namespace.getRoute()
An endpoint to get information about an entity.A code representing an NDR conformance target, or null if the namespace is not meant to be conformant.getTitle()
A descriptive label or title used to identify an entity.getTypes()
getUri()
A normative identifier for a namespace.Gets the version to which this namespace belongs.int
hashCode()
boolean
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.void
setCategory
(Namespace.Category category) A kind of namespace.void
setDefinition
(String definition) A definition that describes a namespace.void
A draft version of a namespace.void
setFilename
(String filename) The filename to use for representations of this namespace such as XML schemas, without a file extension.void
setFilepath
(String filepath) The filepath to use for nested representations of this namespace such as for XML schemas, without the filename or extension.void
setGeneration
(Namespace.Generation generation) A means by which a namespace should be generated.void
A name of a namespace.void
A short, non-normative identifier for a namespace.void
setProperties
(Set<Property> properties) void
setTarget
(Namespace.NdrTarget target) A code representing an NDR conformance target, or null if the namespace is not meant to be conformant.void
void
A normative identifier for a namespace.void
setVersion
(Version version) Model version in which this entity is defined.org.mitre.niem.cmf.Namespace
toCmf()
Converts this namespace to a CMF namespace object.toString()
Gets key fields about a namespace.Methods inherited from class gov.niem.tools.api.db.base.BaseVersionEntity
getModel, getNext, getNiemVersion, getNiemVersionNumber, getOriginal, getPrev, getVersionId, getVersionNumber, getVersionSummary, isDeprecated, isOriginal, setDeprecated, setNext, setOriginal, setPrev
Methods inherited from class gov.niem.tools.api.db.base.BaseModelEntity
getModelKey, getModelSummary, getSteward
Methods inherited from class gov.niem.tools.api.db.base.BaseStewardEntity
getStewardKey, getStewardSummary
Methods inherited from class gov.niem.tools.api.db.base.BaseEntity
getCreatedBy, getCreatedDate, getId, getLastModifiedBy, getLastModifiedDate, setCreatedBy, setCreatedDate, setId, setLastModifiedBy, setLastModifiedDate
-
Constructor Details
-
Namespace
-
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 newNamespace
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)
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
Gets the version to which this namespace belongs.- Specified by:
getVersion
in classBaseVersionEntity<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
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 classBaseEntity
-
getRoute
Description copied from class:BaseEntity
An endpoint to get information about an entity.- Specified by:
getRoute
in classBaseEntity
-
getClassName
Description copied from class:BaseEntity
A kind of NIEM entity, such as a Namespace or a Property.- Overrides:
getClassName
in classBaseEntity
-
getFullIdentifier
Description copied from class:BaseEntity
A human-readable and url-friendly unique identifier for an entity.- Specified by:
getFullIdentifier
in classBaseEntity
-
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 classBaseEntity
-
getTitle
Description copied from class:BaseEntity
A descriptive label or title used to identify an entity.- Specified by:
getTitle
in classBaseEntity
-
getConformanceTargetName
Returns the name of the conformance target. For example, for a REF target, returns "Reference". -
getNiemVersionMajorDigit
Returns the first digit of the NIEM version compatible with this namespace. -
getNdrVersion
Gets the NDR version for this namespace, based on the version of NIEM that is compatible with this namespace. -
getNdrConformanceTarget
Gets the conformance target URI based on the target and NIEM version number of this namespace. -
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 interfaceBaseCmfEntity<org.mitre.niem.cmf.Namespace>
- Throws:
org.mitre.niem.cmf.CMFException
-
toCmf
public org.mitre.niem.cmf.Namespace toCmf() throws org.mitre.niem.cmf.CMFExceptionConverts this namespace to a CMF namespace object.- Specified by:
toCmf
in interfaceBaseCmfEntity<org.mitre.niem.cmf.Namespace>
- Throws:
org.mitre.niem.cmf.CMFException
-
categoryFromCmf
Converts CMF namespace categories to API namespace categories. -
categoryToCmf
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
-
getPrefix
A short, non-normative identifier for a namespace. -
getName
A name of a namespace. -
getUri
A normative identifier for a namespace. -
getDefinition
A definition that describes a namespace. -
getCategory
A kind of namespace. -
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
A code representing an NDR conformance target, or null if the namespace is not meant to be conformant. -
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)
-
getFilename
The filename to use for representations of this namespace such as XML schemas, without a file extension. -
getFilepath
The filepath to use for nested representations of this namespace such as for XML schemas, without the filename or extension. -
getTypes
-
getProperties
-
setVersion
Model version in which this entity is defined. -
setPrefix
A short, non-normative identifier for a namespace. -
setName
A name of a namespace. -
setUri
A normative identifier for a namespace. -
setDefinition
A definition that describes a namespace. -
setCategory
A kind of namespace. -
setDraft
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
A code representing an NDR conformance target, or null if the namespace is not meant to be conformant. -
setGeneration
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)
-
setFilename
The filename to use for representations of this namespace such as XML schemas, without a file extension. -
setFilepath
The filepath to use for nested representations of this namespace such as for XML schemas, without the filename or extension. -
setTypes
-
setProperties
-
toString
- Overrides:
toString
in classBaseVersionEntity<Namespace>
-
equals
- Overrides:
equals
in classBaseVersionEntity<Namespace>
-
canEqual
- Overrides:
canEqual
in classBaseVersionEntity<Namespace>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classBaseVersionEntity<Namespace>
-