org.openmdx.base.text.format
Class DatatypeFormat

java.lang.Object
  extended by org.openmdx.base.text.format.DatatypeFormat
All Implemented Interfaces:
Marshaller

public class DatatypeFormat
extends Object
implements Marshaller

DatatypeFormat


Method Summary
 Object marshal(Object source)
          Marshals an object
static DatatypeFormat newInstance(boolean basicFormat)
          Factory method
 XMLGregorianCalendar parseDate(String date)
          Parse a date String
 XMLGregorianCalendar parseDateTime(String dateTime)
          Parse a date-time String
 Duration parseDuration(String duration)
          Parse a duration String
 Object unmarshal(Object source)
          Unmarshals an object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static DatatypeFormat newInstance(boolean basicFormat)
                                  throws ServiceException
Factory method

Parameters:
basicFormat - use ISO 8601 basic format if true; ISO 8601 extended format otherwise.
Returns:
a new DatatypeFormat instance
Throws:
ServiceException - if the DatatypeFactory can't be acquired

unmarshal

public Object unmarshal(Object source)
                 throws ServiceException
Description copied from interface: Marshaller
Unmarshals an object

Specified by:
unmarshal in interface Marshaller
Parameters:
source - The marshalled object
Returns:
The unmarshalled object
Throws:
ServiceException - MARSHAL_FAILURE: Object can't be unmarshalled

marshal

public Object marshal(Object source)
               throws ServiceException
Description copied from interface: Marshaller
Marshals an object

Specified by:
marshal in interface Marshaller
Parameters:
source - The object to be marshalled
Returns:
The marshalled object
Throws:
ServiceException - MARSHAL_FAILURE: Object can't be marshalled

parseDuration

public Duration parseDuration(String duration)
Parse a duration String

Parameters:
duration - a duration as String
Returns:
a corrsponding Duration instance

parseDate

public XMLGregorianCalendar parseDate(String date)
Parse a date String

Parameters:
date - a date in the format yyyymmdd
Returns:
a corresponding XMLGregorianCalendar instance

parseDateTime

public XMLGregorianCalendar parseDateTime(String dateTime)
Parse a date-time String

Parameters:
dateTime - a date in the format yyyymmddThhmmss.mmmZ
Returns:
a corresponding XMLGregorianCalendar instance


This software is published under the BSD license. Copyright © 2003-2008, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.