|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.biomoby.shared.MobyData org.biomoby.shared.MobyPrimaryData org.biomoby.shared.MobyPrimaryDataSimple org.biomoby.shared.data.MobyDataObject org.biomoby.shared.data.MobyDataDateTime
public class MobyDataDateTime
A class representing a MOBY DateTime, which is a primitive in MOBY. This is a useful utility class that parses and outputs dates and times in proper ISO 8601 format as required by the MOBY object description. For a description of ISO 8601 as used on the Web, see http://www.w3.org/TR/NOTE-datetime Because getObject() will return a mutable GregorianCalendar, you can use its methods to modify the underlying date of this MOBY object. Since it is a Gregorian calendar, if you are representing dates before September 14th, 1752, I guarantee nothing.
Field Summary |
---|
Fields inherited from interface org.biomoby.shared.data.MobyDataInstance |
---|
CENTRAL_XML_MODE, SERVICE_XML_MODE |
Constructor Summary | |
---|---|
MobyDataDateTime(Element element)
Construct the object using a DOM fragment. |
|
MobyDataDateTime(Element element,
Registry registry)
|
|
MobyDataDateTime(GregorianCalendar cal)
|
|
MobyDataDateTime(String stringISO8601)
|
|
MobyDataDateTime(String articleName,
GregorianCalendar cal)
|
|
MobyDataDateTime(String articleName,
GregorianCalendar cal,
Registry registry)
|
|
MobyDataDateTime(String articleName,
String stringISO8601)
Constructor to build a MOBY DateTime object using the W3C profile of an ISO 8601 formatted input string. |
|
MobyDataDateTime(String articleName,
String stringISO8601,
Registry registry)
|
Method Summary | |
---|---|
MobyDataDateTime |
clone()
Simply calls new constructor with object's existing data type, name and value. |
Object |
getObject()
Gives access to the Java object instance underlying the MobyData instance. |
static String |
getString(GregorianCalendar cvalue)
A utility (static) method converting a GregorianCalendar object to an ISO 8601 string. |
String |
getValue()
A lexical (prefereably human readable) representation of the underlying object value (not including the namespace and ID). |
static GregorianCalendar |
parseISO8601(String dateTime)
For a description of ISO 8601 as used on the Web, see http://www.w3.org/TR/NOTE-datetime This method is based on org.w3.util.DateParser v. 1.4 by Benoît Mahé (bmahe@w3.org) |
String |
toString()
Return an ISO 8601 string representing the date/time represented by this Calendar. |
String |
toXML()
This class sanitizes strings of XML escape characters such as the ampersand (&) and the less-than sign (<). |
Methods inherited from class org.biomoby.shared.data.MobyDataObject |
---|
addCrossReference, addCrossReferences, addCrossReferences, addProvisionInfo, compareTo, createInstanceFromDOM, createInstanceFromDOM, createInstanceFromString, createInstanceFromString, createInstanceFromXML, equals, getCrossReferences, getId, getName, getPrimaryNamespace, getProvisionInfo, getTextContents, getXmlMode, hasCrossReferences, setId, setName, setPrimaryNamespace, setProvisionInfo, setXmlMode |
Methods inherited from class org.biomoby.shared.MobyPrimaryDataSimple |
---|
addNamespace, format, getDataType, getNamespaces, removeNamespace, removeNamespace, setDataType, setNamespaces |
Methods inherited from class org.biomoby.shared.MobyPrimaryData |
---|
isPrimary |
Methods inherited from class org.biomoby.shared.MobyData |
---|
getId, getName, getUserData, setUserData |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.biomoby.shared.data.MobyDataInstance |
---|
getName, getUserData, setUserData |
Constructor Detail |
---|
public MobyDataDateTime(Element element) throws IllegalArgumentException
IllegalArgumentException
- if the element is not a DateTime tag, or the text children of the element do not encode a valid ISO8601 date/timepublic MobyDataDateTime(Element element, Registry registry) throws IllegalArgumentException
IllegalArgumentException
public MobyDataDateTime(String articleName, String stringISO8601) throws IllegalArgumentException
stringISO8601
- if null, the current local date and time is used
IllegalArgumentException
public MobyDataDateTime(String articleName, String stringISO8601, Registry registry) throws IllegalArgumentException
IllegalArgumentException
public MobyDataDateTime(String stringISO8601)
public MobyDataDateTime(String articleName, GregorianCalendar cal)
public MobyDataDateTime(String articleName, GregorianCalendar cal, Registry registry)
public MobyDataDateTime(GregorianCalendar cal)
Method Detail |
---|
public static GregorianCalendar parseISO8601(String dateTime) throws IllegalArgumentException
dateTime
- if null, the current local date and time is used, otherwise a valid ISO 8601 string
IllegalArgumentException
public Object getObject()
MobyDataObject
getObject
in interface MobyDataInstance
getObject
in class MobyDataObject
public String toString()
toString
in class MobyDataObject
public static String getString(GregorianCalendar cvalue)
public MobyDataDateTime clone()
MobyDataObject
clone
in class MobyDataObject
public String getValue()
MobyDataObject
getValue
in class MobyDataObject
public String toXML()
toXML
in interface MobyDataInstance
toXML
in class MobyDataObject
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |