com.wewebu.ow.server.ecmimpl.opencmis.util
Class OwCMISDateTime

java.lang.Object
  extended by com.wewebu.ow.server.ecmimpl.opencmis.util.OwCMISDateTime

public class OwCMISDateTime
extends Object

Date handling utility for CMIS adapter.
The main purpose of this utility is to implement String to Date and reversed conversions with respect to the Date String format specified by CMIS : YYYY-MM-DDThh:mm:ss.sss[Z | +hh:mm | -hh:mm]. The implementation relays on the GregorianCalendar implementation.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Constructor Summary
OwCMISDateTime(Date date_p, TimeZone timeZone_p)
          Constructor
OwCMISDateTime(GregorianCalendar calendar_p)
           
OwCMISDateTime(String dateLexicalRepresentation_p)
          Constructor
 
Method Summary
 boolean equals(Object obj_p)
           
 GregorianCalendar getCalendar()
           
 Date getDate(boolean ignoreTimeZone_p)
           
 TimeZone getTimeZone()
           
 XMLGregorianCalendar getXMLGregorianCalendar()
           
 XMLGregorianCalendar getXMLGregorianCalendar(boolean ignoreTimeZone_p)
           
 int hashCode()
           
 String toCMISDateTimeString()
           
 String toCMISDateTimeString(boolean omitTimeZone_p)
           
 String toISODateTimeString()
           
 String toISODateTimeString(boolean omitTimeZone_p)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwCMISDateTime

public OwCMISDateTime(String dateLexicalRepresentation_p)
               throws com.wewebu.ow.server.exceptions.OwInvalidOperationException
Constructor

Parameters:
dateLexicalRepresentation_p - String representation of a CMIS date
Example:
"2000-01-01T06:20:13.080+07:00"
"2009-17-10T06:20:13.080Z"
"2010-06-01T06:20:13.080"
"2000-01-01T06:20:13.080+0300"
"2000-01-01T06:20:13.080-0100"
Throws:
com.wewebu.ow.server.exceptions.OwInvalidOperationException

OwCMISDateTime

public OwCMISDateTime(GregorianCalendar calendar_p)

OwCMISDateTime

public OwCMISDateTime(Date date_p,
                      TimeZone timeZone_p)
               throws com.wewebu.ow.server.exceptions.OwInvalidOperationException
Constructor

Parameters:
date_p - date represented by this object
timeZone_p - the time zone to represent the given date in
Throws:
com.wewebu.ow.server.exceptions.OwInvalidOperationException - if cannot create/convert to GregorianCalendar
Method Detail

toCMISDateTimeString

public String toCMISDateTimeString()
Returns:
a CMIS String representation of this date time object

toISODateTimeString

public String toISODateTimeString()

toISODateTimeString

public String toISODateTimeString(boolean omitTimeZone_p)

toCMISDateTimeString

public String toCMISDateTimeString(boolean omitTimeZone_p)
Parameters:
omitTimeZone_p - if true the time zone part of the string representation will be omitted
if false the string representation will include the time zone part
Returns:
a CMIS String representation of this date time object

getDate

public Date getDate(boolean ignoreTimeZone_p)
Parameters:
ignoreTimeZone_p - if true ???
Returns:
the Date representation of this object

getCalendar

public GregorianCalendar getCalendar()
Returns:
the GregorianCalendar representation of this object; the TimeZone of the returned Calendar will be set to the closest TimeZone as given by TimeZone.getAvailableIDs(int) for this dates UTC offset

getXMLGregorianCalendar

public XMLGregorianCalendar getXMLGregorianCalendar()
Returns:
the XMLGregorianCalendar representation of this date time object

getXMLGregorianCalendar

public XMLGregorianCalendar getXMLGregorianCalendar(boolean ignoreTimeZone_p)
Parameters:
ignoreTimeZone_p - if true the returned XMLGregorianCalendar will have an undefined time zone
Returns:
the XMLGregorianCalendar representation of this date time object

getTimeZone

public TimeZone getTimeZone()
Returns:
the time zone of this date time object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj_p)
Overrides:
equals in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.