public final class Dates extends AbstractBaseComponent
| Strictness |
|---|
|
DDMSence allows the following legal, but nonsensical constructs:
|
| Nested Elements |
|---|
ddms:acquiredOn: the acquisition date (0-many, starting in DDMS 4.1), implemented as an ApproximableDate |
| Attributes |
|---|
|
ddms:created: creation date (optional) ddms:posted: posting date (optional) ddms:validTil: expiration date (optional) ddms:infoCutOff: info cutoff date (optional) ddms:approvedOn: approved for posting date (optional, starting in DDMS 3.1) ddms:receivedOn: received date (optional, starting in DDMS 4.0.1) |
| Modifier and Type | Class and Description |
|---|---|
static class |
Dates.Builder
Builder for this DDMS component.
|
| Constructor and Description |
|---|
Dates(nu.xom.Element element)
Constructor for creating a component from a XOM Element
|
Dates(List<ApproximableDate> acquiredOns,
String created,
String posted,
String validTil,
String infoCutOff,
String approvedOn,
String receivedOn)
Constructor for creating a component from raw data.
|
Dates(String created,
String posted,
String validTil,
String infoCutOff,
String approvedOn,
String receivedOn)
Deprecated.
A new constructor was added for DDMS 4.1 to support ddms:acquiredOn. This constructor is preserved for
backwards compatibility, but may disappear in the next major release.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Test for logical equality.
|
List<ApproximableDate> |
getAcquiredOns()
Accessor for the acquiredOn dates (0-many optional).
|
javax.xml.datatype.XMLGregorianCalendar |
getApprovedOn()
Deprecated.
Because DDMS 4.1 added a new allowable date format (ddms:DateHourMinType),
XMLGregorianCalendar is no longer a sufficient representation. This accessor will return
null for dates in the new format. Use
getApprovedOnString() to
access the raw XML format of the date instead. |
String |
getApprovedOnString()
Accessor for the approved on date (optional).
|
javax.xml.datatype.XMLGregorianCalendar |
getCreated()
Deprecated.
Because DDMS 4.1 added a new allowable date format (ddms:DateHourMinType),
XMLGregorianCalendar is no longer a sufficient representation. This accessor will return
null for dates in the new format. Use
getCreatedString() to
access the raw XML format of the date instead. |
String |
getCreatedString()
Accessor for the created date (optional).
|
javax.xml.datatype.XMLGregorianCalendar |
getInfoCutOff()
Deprecated.
Because DDMS 4.1 added a new allowable date format (ddms:DateHourMinType),
XMLGregorianCalendar is no longer a sufficient representation. This accessor will return
null for dates in the new format. Use
getInfoCutOffString() to
access the raw XML format of the date instead. |
String |
getInfoCutOffString()
Accessor for the cutoff date (optional).
|
static String |
getName(DDMSVersion version)
Accessor for the element name of this component, based on the version of DDMS used
|
protected List<IDDMSComponent> |
getNestedComponents()
Accessor for a collection of nested components.
|
String |
getOutput(boolean isHTML,
String prefix,
String suffix)
Renders this component as HTML or Text, with an optional prefix to nest it.
|
javax.xml.datatype.XMLGregorianCalendar |
getPosted()
Deprecated.
Because DDMS 4.1 added a new allowable date format (ddms:DateHourMinType),
XMLGregorianCalendar is no longer a sufficient representation. This accessor will return
null for dates in the new format. Use
getPostedString() to
access the raw XML format of the date instead. |
String |
getPostedString()
Accessor for the posted date (optional).
|
javax.xml.datatype.XMLGregorianCalendar |
getReceivedOn()
Deprecated.
Because DDMS 4.1 added a new allowable date format (ddms:DateHourMinType),
XMLGregorianCalendar is no longer a sufficient representation. This accessor will return
null for dates in the new format. Use
getReceivedOnString() to
access the raw XML format of the date instead. |
String |
getReceivedOnString()
Accessor for the received on date (optional).
|
javax.xml.datatype.XMLGregorianCalendar |
getValidTil()
Deprecated.
Because DDMS 4.1 added a new allowable date format (ddms:DateHourMinType),
XMLGregorianCalendar is no longer a sufficient representation. This accessor will return
null for dates in the new format. Use
getValidTilString() to
access the raw XML format of the date instead. |
String |
getValidTilString()
Accessor for the expiration date (optional).
|
int |
hashCode()
Returns a hashcode for the component.
|
protected void |
validate()
Validates the component.
|
protected void |
validateWarnings()
Validates any conditions that might result in a warning.
|
addDdms40Warning, addWarning, addWarnings, buildIndex, buildOutput, buildOutput, buildPrefix, getAttributeValue, getAttributeValue, getChild, getChildTextAsDouble, getDDMSVersion, getLocatorSuffix, getName, getNamespace, getPrefix, getQualifiedName, getSecurityAttributes, getStringAsDouble, getValidationWarnings, getXOMElement, getXOMElementCopy, requireVersion, setXOMElement, toHTML, toString, toText, toXMLpublic Dates(nu.xom.Element element)
throws InvalidDDMSException
element - the XOM element representing thisInvalidDDMSException - if any required information is missing or malformedpublic Dates(String created,
String posted,
String validTil,
String infoCutOff,
String approvedOn,
String receivedOn)
throws InvalidDDMSException
created - the creation date (optional)posted - the posting date (optional)validTil - the expiration date (optional)infoCutOff - the info cutoff date (optional)approvedOn - the approved on date (optional, starting in DDMS 3.1)receivedOn - the received on date (optional, starting in DDMS 4.0.1)InvalidDDMSException - if any required information is missing or malformedpublic Dates(List<ApproximableDate> acquiredOns, String created, String posted, String validTil, String infoCutOff, String approvedOn, String receivedOn) throws InvalidDDMSException
acquiredOns - the acquisition dates (optional, starting in DDMS 4.1)created - the creation date (optional)posted - the posting date (optional)validTil - the expiration date (optional)infoCutOff - the info cutoff date (optional)approvedOn - the approved on date (optional, starting in DDMS 3.1)receivedOn - the received on date (optional, starting in DDMS 4.0.1)InvalidDDMSException - if any required information is missing or malformedprotected void validate()
throws InvalidDDMSException
| Rules |
|---|
|
|
validate in class AbstractBaseComponentInvalidDDMSExceptionAbstractBaseComponent.validate()protected void validateWarnings()
| Rules |
|---|
|
|
validateWarnings in class AbstractBaseComponentpublic String getOutput(boolean isHTML,
String prefix,
String suffix)
AbstractBaseComponentgetOutput in class AbstractBaseComponentisHTML - true for HTML, false for Text.prefix - an optional prefix to put on each name.suffix - an optional suffix to append to each name, such as an index.AbstractBaseComponent.getOutput(boolean, String, String)protected List<IDDMSComponent> getNestedComponents()
AbstractBaseComponentgetNestedComponents in class AbstractBaseComponentAbstractBaseComponent.getNestedComponents()public boolean equals(Object obj)
AbstractBaseComponentThe base case tests against the name value and namespaceURI, as well as any child components classified as "nested components" and any security attributes. Extending classes may require additional rules for equality. This case automatically includes any nested components or security attributes.
equals in class AbstractBaseComponentObject.equals(Object)public int hashCode()
AbstractBaseComponentThis automatically includes any nested components or security attributes.
hashCode in class AbstractBaseComponentObject.hashCode()public static String getName(DDMSVersion version)
version - the DDMSVersionpublic javax.xml.datatype.XMLGregorianCalendar getCreated()
getCreatedString() to
access the raw XML format of the date instead.public String getCreatedString()
public javax.xml.datatype.XMLGregorianCalendar getPosted()
getPostedString() to
access the raw XML format of the date instead.public String getPostedString()
public javax.xml.datatype.XMLGregorianCalendar getValidTil()
getValidTilString() to
access the raw XML format of the date instead.public String getValidTilString()
public javax.xml.datatype.XMLGregorianCalendar getInfoCutOff()
getInfoCutOffString() to
access the raw XML format of the date instead.public String getInfoCutOffString()
public javax.xml.datatype.XMLGregorianCalendar getApprovedOn()
getApprovedOnString() to
access the raw XML format of the date instead.public String getApprovedOnString()
public javax.xml.datatype.XMLGregorianCalendar getReceivedOn()
getReceivedOnString() to
access the raw XML format of the date instead.public String getReceivedOnString()
public List<ApproximableDate> getAcquiredOns()
Copyright 2010 - 2013 by Brian Uri!
Generated on 12/15/2013 10:22 AM
http://ddmsence.urizone.net/