org.inria.ns.reflex.processor.asl.types.xs
Class DateTimeType

java.lang.Object
  extended by org.inria.ns.reflex.processor.asl.types.xs.DateTimeType
All Implemented Interfaces:
NamedType, Type
Direct Known Subclasses:
DateType, TimeType

public class DateTimeType
extends Object
implements Type

The #xs:dateTime type.

Author:
Philippe Poulard

Constructor Summary
DateTimeType()
           
 
Method Summary
 TypedData cast(Object o, XPathContext context)
          Cast an object to an xs:dateTime.
 Comparator getComparator()
          Return a comparator that compares dates.
 Schema getOwnerSchema()
          Return the schema that owns this type definition.
 QName getParentType()
          Return #xs:anySimpleType.
 QName getTypeName()
          Return #xs:dateTime.
 TypedData parse(String date, XPathContext context)
          Parses a string to a date-time.
 TypedData parse(TextCandidate date, XPathContext context)
          Parses a string to a date-time.
 TypedData parse(TypedData data, XPathContext context)
          Parses the remainder of a typed data to a date-time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTimeType

public DateTimeType()
Method Detail

parse

public TypedData parse(TextCandidate date,
                       XPathContext context)
                throws TypeFormatException
Parses a string to a date-time.

Specified by:
parse in interface Type
Parameters:
date - The date to parse.
context - Not used.
Returns:
The typed date that wraps the date and the remainder.
Throws:
TypeFormatException - When the input string can't be a date-time.
See Also:
CalendarData

parse

public TypedData parse(TypedData data,
                       XPathContext context)
                throws TypeFormatException
Parses the remainder of a typed data to a date-time.

Parameters:
data - The data that has a remainder to parse.
context - Not used.
Returns:
The typed data that wraps the date and the remainder.
Throws:
TypeFormatException - When the input string can't be a date-time.
See Also:
CalendarData

parse

public TypedData parse(String date,
                       XPathContext context)
                throws TypeFormatException
Parses a string to a date-time.

Parameters:
date - The date to parse.
context - Not used.
Returns:
The typed data that wraps the date and the remainder.
Throws:
TypeFormatException - When the input string can't be a date-time.
See Also:
CalendarData

cast

public TypedData cast(Object o,
                      XPathContext context)
               throws TypeFormatException
Cast an object to an xs:dateTime.

Specified by:
cast in interface Type
Parameters:
o - The object to cast.
context - Not used.
Returns:
The typed data that wraps the date.
Throws:
TypeFormatException - When the input object can't be a date-time.
See Also:
CalendarData

getTypeName

public QName getTypeName()
Return #xs:dateTime.

Specified by:
getTypeName in interface NamedType
Returns:
xs:dateTime.

getParentType

public QName getParentType()
Return #xs:anySimpleType.

Specified by:
getParentType in interface Type
Returns:
xs:anySimpleType.
See Also:
AnySimpleType

getOwnerSchema

public Schema getOwnerSchema()
Return the schema that owns this type definition.

Specified by:
getOwnerSchema in interface Type
Returns:
The schema that owns this type definition.
See Also:
Type.getOwnerSchema()

getComparator

public Comparator getComparator()
Return a comparator that compares dates.

Specified by:
getComparator in interface Type
Returns:
A non-null comparator that may comparate datas of this type.
See Also:
Type.getComparator()