org.whattf.datatype
Class AbstractDatetime

java.lang.Object
  extended by org.whattf.datatype.AbstractDatatype
      extended by org.whattf.datatype.AbstractDatetime
All Implemented Interfaces:
Datatype
Direct Known Subclasses:
Date, DateOrTime, DateOrTimeContent, Datetime, DatetimeLocal, DatetimeTz, Time

abstract class AbstractDatetime
extends AbstractDatatype

Superclass for various datetime datatypes.

Version:
$Id: AbstractDatetime.java,v 1.8 2006/11/26 14:22:54 hsivonen Exp $
Author:
hsivonen

Field Summary
private static int[] DAYS_IN_MONTHS
          Days in monts on non-leap years.
 
Fields inherited from interface org.relaxng.datatype.Datatype
ID_TYPE_ID, ID_TYPE_IDREF, ID_TYPE_IDREFS, ID_TYPE_NULL
 
Constructor Summary
AbstractDatetime()
          Constructor.
 
Method Summary
private  void checkDate(int year, int month, int day)
           
private  void checkDate(String year, String month, String day)
           
private  void checkHour(int hour)
           
protected  void checkHour(String hour)
           
private  void checkMinute(int minute)
           
protected  void checkMinute(String minute)
           
private  void checkSecond(int second)
           
protected  void checkSecond(String second)
           
private  void checkTzd(int hours, int minutes)
           
private  void checkTzd(String hours, String minutes)
           
 void checkValid(CharSequence literal)
           
protected abstract  Pattern getPattern()
           
private  boolean isLeapYear(int year)
           
 
Methods inherited from class org.whattf.datatype.AbstractDatatype
checkValid, createStreamingValidator, createValue, getIdType, isContextDependent, isValid, isWhitespace, sameValue, toAsciiLowerCase, toAsciiLowerCase, valueHashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAYS_IN_MONTHS

private static int[] DAYS_IN_MONTHS
Days in monts on non-leap years.

Constructor Detail

AbstractDatetime

AbstractDatetime()
Constructor.

Method Detail

checkDate

private void checkDate(String year,
                       String month,
                       String day)
                throws DatatypeException
Throws:
DatatypeException

checkDate

private void checkDate(int year,
                       int month,
                       int day)
                throws DatatypeException
Throws:
DatatypeException

isLeapYear

private boolean isLeapYear(int year)

checkHour

protected final void checkHour(String hour)
                        throws DatatypeException
Throws:
DatatypeException

checkHour

private void checkHour(int hour)
                throws DatatypeException
Throws:
DatatypeException

checkMinute

protected final void checkMinute(String minute)
                          throws DatatypeException
Throws:
DatatypeException

checkMinute

private void checkMinute(int minute)
                  throws DatatypeException
Throws:
DatatypeException

checkSecond

protected final void checkSecond(String second)
                          throws DatatypeException
Throws:
DatatypeException

checkSecond

private void checkSecond(int second)
                  throws DatatypeException
Throws:
DatatypeException

checkTzd

private void checkTzd(String hours,
                      String minutes)
               throws DatatypeException
Throws:
DatatypeException

checkTzd

private void checkTzd(int hours,
                      int minutes)
               throws DatatypeException
Throws:
DatatypeException

getPattern

protected abstract Pattern getPattern()

checkValid

public void checkValid(CharSequence literal)
                throws DatatypeException
Specified by:
checkValid in class AbstractDatatype
Throws:
DatatypeException