public final class SecurityAttributes extends AbstractAttributeGroup
In DDMS | 2.0 | 3.0 | 3.1 | 4.0.1/4.1 | 5.0 |
History |
---|
None. |
Nested Elements | |||
---|---|---|---|
|
Attributes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Validation Rules | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
When validating this attribute group, the required/optional nature of the classification and
ownerProducer attributes are not checked. Because that limitation depends on the parent element (for example,
ddms:title requires them, but ddms:creator does not), the parent element should be responsible for checking, via
At this time, logical validation is only done on the data types of the various attributes, and the controlled vocabulary enumerations behind some of the attributes. Any further validation would require integration with ISM Schematron files as discussed in the Schematron Validation Power Tip on the website. |
Modifier and Type | Class and Description |
---|---|
static class |
SecurityAttributes.Builder
Builder for these attributes.
|
Modifier and Type | Field and Description |
---|---|
static String |
ATOMIC_ENERGY_MARKINGS_NAME
Attribute name
|
static String |
CLASSIFICATION_NAME
Attribute name
|
static String |
CLASSIFICATION_REASON_NAME
Attribute name
|
static String |
CLASSIFIED_BY_NAME
Attribute name
|
static String |
COMPILATION_REASON_NAME
Attribute name
|
static String |
DATE_OF_EXEMPTED_SOURCE_NAME
Attribute name
|
static String |
DECLASS_DATE_NAME
Attribute name
|
static String |
DECLASS_EVENT_NAME
Attribute name
|
static String |
DECLASS_EXCEPTION_NAME
Attribute name
|
static String |
DECLASS_MANUAL_REVIEW_NAME
Attribute name
|
static String |
DERIVATIVELY_CLASSIFIED_BY_NAME
Attribute name
|
static String |
DERIVED_FROM_NAME
Attribute name
|
static String |
DISPLAY_ONLY_TO_NAME
Attribute name
|
static String |
DISSEMINATION_CONTROLS_NAME
Attribute name
|
static String |
FGI_SOURCE_OPEN_NAME
Attribute name
|
static String |
FGI_SOURCE_PROTECTED_NAME
Attribute name
|
static Set<String> |
NON_EXTENSIBLE_NAMES
A set of all SecurityAttribute names which should not be converted into ExtensibleAttributes
|
static String |
NON_IC_MARKINGS_NAME
Attribute name
|
static String |
NON_US_CONTROLS_NAME
Attribute name
|
static String |
OWNER_PRODUCER_NAME
Attribute name
|
static String |
RELEASABLE_TO_NAME
Attribute name
|
static String |
SAR_IDENTIFIER_NAME
Attribute name
|
static String |
SCI_CONTROLS_NAME
Attribute name
|
static String |
TYPE_OF_EXEMPTED_SOURCE_NAME
Attribute name
|
INCOMPATIBLE_VERSION_MESSAGE
Constructor and Description |
---|
SecurityAttributes(nu.xom.Element element)
Base constructor
|
SecurityAttributes(String classification,
List<String> ownerProducers,
Map<String,String> otherAttributes)
Constructor which builds from raw data.
|
Modifier and Type | Method and Description |
---|---|
void |
addTo(nu.xom.Element element)
Convenience method to add these attributes onto an existing XOM Element
|
boolean |
equals(Object obj) |
List<String> |
getAtomicEnergyMarkings()
Accessor for the atomicEnergyMarkings attribute.
|
String |
getClassification()
Accessor for the classification attribute.
|
String |
getClassificationReason()
Accessor for the classificationReason attribute.
|
String |
getClassifiedBy()
Accessor for the classifiedBy attribute.
|
String |
getCompilationReason()
Accessor for the compilationReason attribute.
|
javax.xml.datatype.XMLGregorianCalendar |
getDateOfExemptedSource()
Accessor for the dateOfExemptedSource attribute.
|
javax.xml.datatype.XMLGregorianCalendar |
getDeclassDate()
Accessor for the declassDate attribute.
|
String |
getDeclassEvent()
Accessor for the declassEvent attribute.
|
String |
getDeclassException()
Accessor for the declassException attribute.
|
Boolean |
getDeclassManualReview()
Accessor for the declassManualReview attribute.
|
String |
getDerivativelyClassifiedBy()
Accessor for the derivativelyClassifiedBy attribute.
|
String |
getDerivedFrom()
Accessor for the derivedFrom attribute.
|
List<String> |
getDisplayOnlyTo()
Accessor for the displayOnlyTo attribute.
|
List<String> |
getDisseminationControls()
Accessor for the disseminationControls attribute.
|
List<String> |
getFGIsourceOpen()
Accessor for the FGIsourceOpen attribute.
|
List<String> |
getFGIsourceProtected()
Accessor for the FGIsourceProtected attribute.
|
String |
getHTMLTextOutput(OutputFormat format,
String prefix)
Outputs to HTML or Text with a prefix at the beginning of each meta tag or line.
|
com.google.gson.JsonObject |
getJSONObject()
Renders this component as a JSON object, which can either be converted to
a JSON string or inserted into the parent JSON object.
|
String |
getName()
Returns a name that describes this attribute group.
|
List<String> |
getNonICmarkings()
Accessor for the nonICmarkings attribute.
|
static SecurityAttributes |
getNonNullInstance(SecurityAttributes securityAttributes)
Returns a non-null instance of security attributes.
|
List<String> |
getNonUSControls()
Accessor for the nonUSControls attribute.
|
List<String> |
getOwnerProducers()
Accessor for the ownerProducers attribute.
|
List<String> |
getReleasableTo()
Accessor for the releasableTo attribute.
|
List<String> |
getSARIdentifier()
Accessor for the SARIdentifier attribute.
|
List<String> |
getSCIcontrols()
Accessor for the SCIcontrols attribute.
|
String |
getTypeOfExemptedSource()
Accessor for the typeOfExemptedSource attribute.
|
int |
hashCode() |
boolean |
isEmpty()
Checks if any attributes have been set.
|
void |
requireClassification()
Standalone validation method for components which require a classification and ownerProducer.
|
protected void |
validate(DDMSVersion version)
Validates the attribute group.
|
protected void |
validateCompatibleVersion(DDMSVersion newParentVersion)
Compares the DDMS version of these attributes to another DDMS version
|
addJson, addJson, getNamespace, getValidationWarnings, getWarnings, setNamespace
public static final String ATOMIC_ENERGY_MARKINGS_NAME
public static final String CLASSIFICATION_NAME
public static final String CLASSIFICATION_REASON_NAME
public static final String CLASSIFIED_BY_NAME
public static final String COMPILATION_REASON_NAME
public static final String DATE_OF_EXEMPTED_SOURCE_NAME
public static final String DECLASS_DATE_NAME
public static final String DECLASS_EVENT_NAME
public static final String DECLASS_EXCEPTION_NAME
public static final String DECLASS_MANUAL_REVIEW_NAME
public static final String DERIVATIVELY_CLASSIFIED_BY_NAME
public static final String DERIVED_FROM_NAME
public static final String DISPLAY_ONLY_TO_NAME
public static final String DISSEMINATION_CONTROLS_NAME
public static final String FGI_SOURCE_OPEN_NAME
public static final String FGI_SOURCE_PROTECTED_NAME
public static final String NON_IC_MARKINGS_NAME
public static final String NON_US_CONTROLS_NAME
public static final String OWNER_PRODUCER_NAME
public static final String RELEASABLE_TO_NAME
public static final String SAR_IDENTIFIER_NAME
public static final String SCI_CONTROLS_NAME
public static final String TYPE_OF_EXEMPTED_SOURCE_NAME
public static final Set<String> NON_EXTENSIBLE_NAMES
public SecurityAttributes(nu.xom.Element element) throws InvalidDDMSException
element
- the XOM element which is decorated with these attributes.InvalidDDMSException
public SecurityAttributes(String classification, List<String> ownerProducers, Map<String,String> otherAttributes) throws InvalidDDMSException
The classification and ownerProducer exist as parameters, and any other security markings are passed in as a mapping of local attribute names to String values. This approach is a compromise between a constructor with over seventeen parameters, and the added complexity of a step-by-step factory/builder approach. If any name-value pairing does not correlate with a valid ISM attribute, it will be ignored.
If an attribute mapping appears more than once, the last one in the list will be the one used. If classification and ownerProducer are included in the Map of other attributes, they will be ignored.
classification
- the classification level, which must be a legal classification typeownerProducers
- a list of ownerProducersotherAttributes
- a name/value mapping of other ISM attributes. The value will be a String value, as it
appears in XML.InvalidDDMSException
- if any required information is missing or malformedpublic static SecurityAttributes getNonNullInstance(SecurityAttributes securityAttributes) throws InvalidDDMSException
securityAttributes
- the attributes to return by defaultInvalidDDMSException
- if there are problems creating the empty attributes instancepublic void addTo(nu.xom.Element element) throws InvalidDDMSException
element
- the element to decorateInvalidDDMSException
public boolean isEmpty()
AbstractAttributeGroup
isEmpty
in class AbstractAttributeGroup
AbstractAttributeGroup.isEmpty()
protected void validateCompatibleVersion(DDMSVersion newParentVersion) throws InvalidDDMSException
newParentVersion
- the version to testInvalidDDMSException
- if the versions do not matchprotected void validate(DDMSVersion version) throws InvalidDDMSException
ISMVocabulary
enumerations are validated.validate
in class AbstractAttributeGroup
version
- the DDMS version to validate against. This cannot be stored in the attribute group because some
DDMSVersions have the same attribute XML namespace (e.g. XLink, ISM, NTK, GML after DDMS 2.0).InvalidDDMSException
- if any required information is missing or malformedpublic void requireClassification() throws InvalidDDMSException
InvalidDDMSException
- if there is no classification.public com.google.gson.JsonObject getJSONObject()
AbstractAttributeGroup
I consider this to be an internal method, that unfortunately must be marked as public to allow cross-package access when generating output. Use toJSON() as the formal, public method to generate output.
getJSONObject
in class AbstractAttributeGroup
AbstractAttributeGroup.getJSONObject()
public String getName()
AbstractAttributeGroup
getName
in class AbstractAttributeGroup
AbstractAttributeGroup.getName()
public String getHTMLTextOutput(OutputFormat format, String prefix)
AbstractAttributeGroup
I consider this to be an internal method, that unfortunately must be marked as public to allow cross-package access when generating output. Use toHTML() and toText() as the formal, public methods to generate output.
getHTMLTextOutput
in class AbstractAttributeGroup
format
- the desired format of this outputprefix
- the prefix to addAbstractAttributeGroup.getHTMLTextOutput(OutputFormat, String)
public boolean equals(Object obj)
equals
in class Object
Object.equals(Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public List<String> getAtomicEnergyMarkings()
public String getClassification()
public String getClassificationReason()
public String getClassifiedBy()
public String getCompilationReason()
public javax.xml.datatype.XMLGregorianCalendar getDateOfExemptedSource()
public javax.xml.datatype.XMLGregorianCalendar getDeclassDate()
public String getDeclassEvent()
public String getDeclassException()
public Boolean getDeclassManualReview()
public String getDerivativelyClassifiedBy()
public String getDerivedFrom()
public List<String> getDisplayOnlyTo()
public List<String> getDisseminationControls()
public List<String> getFGIsourceOpen()
public List<String> getFGIsourceProtected()
public List<String> getNonICmarkings()
public List<String> getNonUSControls()
public List<String> getOwnerProducers()
public List<String> getReleasableTo()
public List<String> getSARIdentifier()
public List<String> getSCIcontrols()
public String getTypeOfExemptedSource()
Copyright 2010 - 2019 by Brian Uri!
Generated on 09/15/2016 12:36 PM
https://ddmsence.urizone.net/