org.melati.template
Class YMDDateAdaptor

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

public class YMDDateAdaptor
extends 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 String daySuffix
           
static YMDDateAdaptor it
          The instance.
protected static String monthSuffix
           
protected static String yearSuffix
           
 
Constructor Summary
YMDDateAdaptor()
           
 
Method Summary
 Field dayField(Field dateField)
           
protected  String getFormOrDie(ServletTemplateContext context, String fieldName, String suffix)
           
 Field monthField(Field dateField)
           
 Object rawFrom(ServletTemplateContext context, String fieldName)
          Retrieve a raw value, ie an SQL value, from a ServletTemplateContext.
protected  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 String yearSuffix
See Also:
Constant Field Values

monthSuffix

protected static final String monthSuffix
See Also:
Constant Field Values

daySuffix

protected static final String daySuffix
See Also:
Constant Field Values

it

public static final YMDDateAdaptor it
The instance.

Constructor Detail

YMDDateAdaptor

public YMDDateAdaptor()
Method Detail

getFormOrDie

protected String getFormOrDie(ServletTemplateContext context,
                              String fieldName,
                              String suffix)

rawFrom

public Object rawFrom(ServletTemplateContext context,
                      String fieldName)
Retrieve a raw value, 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 Calendar when(Field dateField)


Copyright © 2000-2010 PanEris. All Rights Reserved.