public final class ApproximableDate extends AbstractBaseComponent
The structure of this class diverges from the usual DDMSence approach of selecting which DDMS components are implemented as Java classes. The ApproximableDateType, introduced in DDMS 4.1, is directly reused in three locations in the DDMS schema, so it is implemented as a final class rather than an Abstract class. It contains one wrapper element, ddms:searchableDate, which is not implemented as a Java class.
This type also contains one element, ddms:approximableDate, which should be implemented as a Java class, since it contains an attribute. To simplify the class structure, this element and its attribute are collapsed into this Java class.
| Strictness |
|---|
|
DDMSence allows the following legal, but nonsensical constructs:
|
| Nested Elements |
|---|
|
ddms:description: A description of this date (0-1, optional) ddms:approximableDate: The value of this date, associated with an optional approximation decorator (0-1, optional) ddms:searchableDate/ddms:start: The exact date which is the lower bound for this approximable date in searches (0-1, optional) ddms:searchableDate/ddms:end: The exact date which is the upper bound for this approximable date in searches (0-1, optional) |
| Attributes |
|---|
|
ddms:approximableDate/ddms:approximation: An attribute that decorates the approximableDate with terms such as
"early" or "late" (0-1, optional) |
| Modifier and Type | Class and Description |
|---|---|
static class |
ApproximableDate.Builder
Builder for this DDMS component.
|
| Constructor and Description |
|---|
ApproximableDate(nu.xom.Element element)
Constructor for creating a component from a XOM Element
|
ApproximableDate(String name,
String description,
String approximableDate,
String approximation,
String searchableStartDate,
String searchableEndDate)
Constructor for creating a component from raw data
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Test for logical equality.
|
String |
getApproximableDateString()
Accessor for the approximableDate (optional).
|
String |
getApproximation()
Accessor for the value of the approximation attribute
|
String |
getDescription()
Accessor for the description.
|
String |
getOutput(boolean isHTML,
String prefix,
String suffix)
Renders this component as HTML or Text, with an optional prefix to nest it.
|
String |
getSearchableEndString()
Accessor for the searchableEnd date (optional)
|
String |
getSearchableStartString()
Accessor for the searchableStart date (optional)
|
int |
hashCode()
Returns a hashcode for the component.
|
protected void |
validate()
Validates the component.
|
static void |
validateApproximation(String approximation)
Validates an approximation against the allowed values.
|
static void |
validateElementName(String name)
Validates an element name against the allowed values.
|
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, getNestedComponents, getPrefix, getQualifiedName, getSecurityAttributes, getStringAsDouble, getValidationWarnings, getXOMElement, getXOMElementCopy, requireVersion, setXOMElement, toHTML, toString, toText, toXMLpublic ApproximableDate(nu.xom.Element element)
throws InvalidDDMSException
element - the XOM element representing thisInvalidDDMSException - if any required information is missing or malformedpublic ApproximableDate(String name,
String description,
String approximableDate,
String approximation,
String searchableStartDate,
String searchableEndDate)
throws InvalidDDMSException
name - the name of the elementdescription - the description of this approximable date (optional)approximableDate - the value of the approximable date (optional)approximation - an attribute that decorates the date (optional)searchableStartDate - the lower bound for this approximable date (optional)searchableEndDate - the upper bound for this approximable date (optional)InvalidDDMSException - if any required information is missing or malformedpublic static void validateApproximation(String approximation)
throws InvalidDDMSException
approximation - the value to testInvalidDDMSException - if the value is null, empty or invalid.public static void validateElementName(String name)
throws InvalidDDMSException
name - the value to testInvalidDDMSException - if the value is null, empty or invalid.protected 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)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 String getDescription()
public String getApproximableDateString()
public String getApproximation()
public String getSearchableStartString()
public String getSearchableEndString()
Copyright 2010 - 2013 by Brian Uri!
Generated on 12/15/2013 10:22 AM
http://ddmsence.urizone.net/