public final class NoticeAttributes extends AbstractAttributeGroup
Resource
and Notice
.
In DDMS | 2.0 | 3.0 | 3.1 | 4.0.1/4.1 | 5.0 |
History |
---|
This class was introduced to support ISM notices in DDMS 4.1. Those components are no longer a part of DDMS 5.0. |
Nested Elements | |||
---|---|---|---|
|
Attributes | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Validation Rules | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Does NOT do any validation on the constraints described in the DES ISM specification. |
Modifier and Type | Class and Description |
---|---|
static class |
NoticeAttributes.Builder
Builder for these attributes.
|
Modifier and Type | Field and Description |
---|---|
static String |
EXTERNAL_NOTICE_NAME
Attribute name
|
static int |
MAX_LENGTH
Maximum length of reason and unregistered notice type attributes.
|
static Set<String> |
NON_EXTENSIBLE_NAMES
A set of all SecurityAttribute names which should not be converted into ExtensibleAttributes
|
static String |
NOTICE_DATE_NAME
Attribute name
|
static String |
NOTICE_REASON_NAME
Attribute name
|
static String |
NOTICE_TYPE_NAME
Attribute name
|
static String |
UNREGISTERED_NOTICE_TYPE_NAME
Attribute name
|
INCOMPATIBLE_VERSION_MESSAGE
Constructor and Description |
---|
NoticeAttributes(nu.xom.Element element)
Base constructor
|
NoticeAttributes(String noticeType,
String noticeReason,
String noticeDate,
String unregisteredNoticeType)
Deprecated.
A new constructor was added for DDMS 4.1 to support ism:externalNotice. This constructor is preserved
for backwards compatibility, but may disappear in the next major release.
|
NoticeAttributes(String noticeType,
String noticeReason,
String noticeDate,
String unregisteredNoticeType,
Boolean externalNotice)
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) |
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.
|
static NoticeAttributes |
getNonNullInstance(NoticeAttributes noticeAttributes)
Returns a non-null instance of notice attributes.
|
javax.xml.datatype.XMLGregorianCalendar |
getNoticeDate()
Accessor for the noticeDate attribute.
|
String |
getNoticeReason()
Accessor for the noticeReason attribute.
|
String |
getNoticeType()
Accessor for the noticeType attribute.
|
String |
getUnregisteredNoticeType()
Accessor for the unregisteredNoticeType attribute.
|
int |
hashCode() |
boolean |
isEmpty()
Checks if any attributes have been set.
|
Boolean |
isExternalReference()
Accessor for the externalNotice attribute.
|
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 NOTICE_TYPE_NAME
public static final String NOTICE_REASON_NAME
public static final String NOTICE_DATE_NAME
public static final String UNREGISTERED_NOTICE_TYPE_NAME
public static final String EXTERNAL_NOTICE_NAME
public static final int MAX_LENGTH
public static final Set<String> NON_EXTENSIBLE_NAMES
public NoticeAttributes(nu.xom.Element element) throws InvalidDDMSException
element
- the XOM element which is decorated with these attributes.InvalidDDMSException
public NoticeAttributes(String noticeType, String noticeReason, String noticeDate, String unregisteredNoticeType) throws InvalidDDMSException
noticeType
- the notice type (with a value from the CVE)noticeReason
- the reason associated with a noticenoticeDate
- the date associated with a noticeunregisteredNoticeType
- a notice type not in the CVEInvalidDDMSException
- if any required information is missing or malformedpublic NoticeAttributes(String noticeType, String noticeReason, String noticeDate, String unregisteredNoticeType, Boolean externalNotice) throws InvalidDDMSException
noticeType
- the notice type (with a value from the CVE)noticeReason
- the reason associated with a noticenoticeDate
- the date associated with a noticeunregisteredNoticeType
- a notice type not in the CVEexternalNotice
- true if this notice is for an external resourceInvalidDDMSException
- if any required information is missing or malformedpublic static NoticeAttributes getNonNullInstance(NoticeAttributes noticeAttributes) throws InvalidDDMSException
noticeAttributes
- 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 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 String getNoticeType()
public String getNoticeReason()
public String getUnregisteredNoticeType()
public Boolean isExternalReference()
public javax.xml.datatype.XMLGregorianCalendar getNoticeDate()
Copyright 2010 - 2019 by Brian Uri!
Generated on 09/15/2016 12:36 PM
https://ddmsence.urizone.net/