|
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.datatypes.MobyObject org.biomoby.shared.datatypes.MobyDateTime
public class MobyDateTime
An object representing a date, or a date and time, a Moby primitive data type.
The value of this object is stored internally as a string, but
during setting it (setValue(java.lang.String)
) it checks for its
validity. The value should follow W3C
profile of the ISO-8601 specification for specifying dates and
times. For example (taken from the specification cited above),
1994-11-05T08:15:30-05:00 corresponds to November 5, 1994,
8:15:30 am, US Eastern Standard Time, and
1994-11-05T13:15:30Z corresponds to the same instant.
Field Summary | |
---|---|
static String[] |
ALLOWED_FORMATS
An array defining all allowed formats for Biomoby DateTime objects. |
static String |
FULL_FORMAT
A string defining (in symbols used in Java's SimpleDateFormat) a full Biomoby DateTime format complying with ISO 8601. |
Constructor Summary | |
---|---|
MobyDateTime()
Default constructor. |
Method Summary | |
---|---|
void |
setValue(String value)
Additionally to the same method in the superclass, it checks for a correct format. |
org.jdom.Element |
toXML()
Create an XML element representing this object. |
Methods inherited from class org.biomoby.shared.datatypes.MobyObject |
---|
addXref, format, getId, getMobyTypeName, getName, getNamespace, getProvision, getValue, getXrefs, isPrimitiveType, setId, setName, setNamespace, setProvision, setValueXML, setXrefs, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String FULL_FORMAT
public static final String[] ALLOWED_FORMATS
Constructor Detail |
---|
public MobyDateTime()
Method Detail |
---|
public org.jdom.Element toXML()
MobyObject
toXML
in class MobyObject
public void setValue(String value) throws MobyException
It also allows values with the time zone in the format "+hhmm"
and "-hhmm" (instead of correct ones "+hh:mm" and
"-hh:mm"). Such values are the result of SimpleDateFormat
constructor when fed with the FULL_FORMAT
.
setValue
in class MobyObject
value
- to be stored; if it is null or an empty string it
creates a date/time of the current moment
MobyException
- if the 'value' does not follow the ISO
8601 specificationhow to set value as CDATA
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |