org.melati.template
Class YMDDateAdaptor

java.lang.Object
  extended by org.melati.template.YMDDateAdaptor
All Implemented Interfaces:
TempletAdaptor
Direct Known Subclasses:
YMDHMSTimestampAdaptor

public class YMDDateAdaptor
extends java.lang.Object
implements TempletAdaptor

An adaptor for a string date in YMD format. See for example org.melati.poem.DatePoemType-dropdown.wm


Field Summary
protected static java.lang.String daySuffix
           
static YMDDateAdaptor it
          The instance.
protected static java.lang.String monthSuffix
           
protected static java.lang.String yearSuffix
           
 
Constructor Summary
YMDDateAdaptor()
           
 
Method Summary
 Field dayField(Field dateField)
           
protected  java.lang.String getFormOrDie(ServletTemplateContext context, java.lang.String fieldName, java.lang.String suffix)
           
 Field monthField(Field dateField)
           
 java.lang.Object rawFrom(ServletTemplateContext context, java.lang.String fieldName)
          Retrieve a raw object, ie an SQL value, from a ServletTemplateContext.
protected  java.util.Calendar when(Field dateField)
           
 Field yearField(Field dateField)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

yearSuffix

protected static final java.lang.String yearSuffix
See Also:
Constant Field Values

monthSuffix

protected static final java.lang.String monthSuffix
See Also:
Constant Field Values

daySuffix

protected static final java.lang.String daySuffix
See Also:
Constant Field Values

it

public static final YMDDateAdaptor it
The instance.

Constructor Detail

YMDDateAdaptor

public YMDDateAdaptor()
Method Detail

getFormOrDie

protected java.lang.String getFormOrDie(ServletTemplateContext context,
                                        java.lang.String fieldName,
                                        java.lang.String suffix)

rawFrom

public java.lang.Object rawFrom(ServletTemplateContext context,
                                java.lang.String fieldName)
Retrieve a raw object, ie an SQL value, from a ServletTemplateContext.

Specified by:
rawFrom in interface TempletAdaptor
Parameters:
context - the ServletTemplateContext the value is stored in
fieldName - the name of the field in the context
Returns:
the raw value
See Also:
rawFrom(org.melati.template.ServletTemplateContext, java.lang.String)

yearField

public Field yearField(Field dateField)
Parameters:
dateField - date field to extract year field from
Returns:
year constituent of date

monthField

public Field monthField(Field dateField)
Parameters:
dateField - date field to extract month field from
Returns:
month constituent of date

dayField

public Field dayField(Field dateField)
Parameters:
dateField - date field to extract day field from
Returns:
day constituent of date

when

protected java.util.Calendar when(Field dateField)


Copyright © 2000-2008 PanEris. All Rights Reserved.