|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jackrabbit.rmi.value.BaseNonStreamValue
org.apache.jackrabbit.rmi.value.DateValue
The DateValue class implements the committed value state for
Date values as a part of the State design pattern (Gof) used by this
package.
To convert Calendar instances to and from strings, this class
uses a SimpleDateFormat instance with the pattern
yyyy-MM-dd'T'HH:mm:ss'Z'. The issue with this pattern is that
the era specification as defined in the JCR specification (+/- prefix) as
well as full time zone naming are not supported.
SerialValue,
Serialized Form| Constructor Summary | |
protected |
DateValue(Calendar value)
Creates an instance for the given Calendar value. |
protected |
DateValue(String value)
Creates an instance for the given string representation of a Calendar. |
| Method Summary | |
Calendar |
getDate()
Returns (a copy) of this Calendar value. |
double |
getDouble()
Returns the time represented by this instance as the number of milliseconds since the epoch (1.1.1970, 0:00, UTC). |
long |
getLong()
Returns the time represented by this instance as the number of milliseconds since the epoch (1.1.1970, 0:00, UTC). |
String |
getString()
Returns the string represented of this Calendar value
formatted using a SimpleDateFormatter with the pattern
yyyy-MM-dd'T'HH:mm:ss'Z'. |
int |
getType()
Returns PropertyType.DATE. |
protected static Calendar |
toCalendar(String value)
Returns the string value parsed into a
Calendar instance. |
| Methods inherited from class org.apache.jackrabbit.rmi.value.BaseNonStreamValue |
getBoolean, getStream, getValueFormatException |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.jcr.Value |
getBoolean, getStream |
| Constructor Detail |
protected DateValue(Calendar value)
Calendar value.
protected DateValue(String value)
throws ValueFormatException
Calendar.
This implementation uses a SimpleDateFormat instance with
the pattern yyyy-MM-dd'T'HH:mm:ss'Z' to parse the string into
a Calendar object. See the class comment for issues regarding
this pattern.
| Method Detail |
protected static Calendar toCalendar(String value)
throws ValueFormatException
value parsed into a
Calendar instance.
value - The string value.
Calendar instance parsed from the string
value.
ValueFormatException - if the string value cannot be parsed into a
Calendar instance.public int getType()
PropertyType.DATE.
getType in interface Valuepublic double getDouble()
getDouble in interface ValuegetDouble in class BaseNonStreamValuepublic String getString()
Calendar value
formatted using a SimpleDateFormatter with the pattern
yyyy-MM-dd'T'HH:mm:ss'Z'. See the class comment for issues
regarding this pattern.
getString in interface Valuepublic long getLong()
getLong in interface ValuegetLong in class BaseNonStreamValuepublic Calendar getDate()
Calendar value. Modifying the
returned Calendar does not change the value of this
instance.
getDate in interface ValuegetDate in class BaseNonStreamValue
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||