|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue
org.exoplatform.services.jcr.rmi.api.value.DateValue
public class 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| Field Summary |
|---|
| Fields inherited from class org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue |
|---|
orderNumber |
| Constructor Summary | |
|---|---|
protected |
DateValue(java.util.Calendar value)
Creates an instance for the given Calendar value. |
protected |
DateValue(java.lang.String value)
Creates an instance for the given string representation of a Calendar. |
| Method Summary | |
|---|---|
java.util.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 |
getLength()
|
long |
getLong()
Returns the time represented by this instance as the number of milliseconds since the epoch (1.1.1970, 0:00, UTC). |
int |
getOrderNumber()
|
java.lang.String |
getString()
Returns the string represented of this Calendar value formatted using a
ISO8601.format with the pattern YYYY-MM-DDThh:mm:ss.sssTZD. |
int |
getType()
Returns PropertyType.DATE. |
protected static java.util.Calendar |
toCalendar(java.lang.String value)
Returns the string value parsed into a Calendar instance. |
| Methods inherited from class org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue |
|---|
getBoolean, getReference, getStream, getValueFormatException, setOrderNumber |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.exoplatform.services.jcr.core.value.ExtendedValue |
|---|
getReference, setOrderNumber |
| Methods inherited from interface javax.jcr.Value |
|---|
getBoolean, getStream |
| Constructor Detail |
|---|
protected DateValue(java.util.Calendar value)
Calendar value.
protected DateValue(java.lang.String value)
throws javax.jcr.ValueFormatException
Calendar.
This implementation uses a ISO8601.format instance with the pattern
YYYY-MM-DDThh:mm:ss.sssTZD to parse the string into a Calendar
object. See the class comment for issues regarding this pattern.
javax.jcr.ValueFormatException| Method Detail |
|---|
protected static java.util.Calendar toCalendar(java.lang.String value)
throws javax.jcr.ValueFormatException
value parsed into a Calendar instance.
value - The string value.
Calendar instance parsed from the string value.
javax.jcr.ValueFormatException - if the string value cannot be parsed into a Calendar instance.public int getType()
PropertyType.DATE.
getType in interface javax.jcr.Valuepublic double getDouble()
getDouble in interface javax.jcr.ValuegetDouble in class BaseNonStreamValue
public java.lang.String getString()
throws javax.jcr.ValueFormatException
Calendar value formatted using a
ISO8601.format with the pattern YYYY-MM-DDThh:mm:ss.sssTZD. See the
class comment for issues regarding this pattern.
getString in interface javax.jcr.Valuejavax.jcr.ValueFormatExceptionpublic long getLong()
getLong in interface javax.jcr.ValuegetLong in class BaseNonStreamValuepublic java.util.Calendar getDate()
Calendar value. Modifying the returned
Calendar does not change the value of this instance.
getDate in interface javax.jcr.ValuegetDate in class BaseNonStreamValuepublic long getLength()
getLength in interface ExtendedValuepublic int getOrderNumber()
getOrderNumber in interface ExtendedValuegetOrderNumber in class BaseNonStreamValue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||