org.mmbase.bridge.jsp.taglib.typehandler
Class DateHandler

java.lang.Object
  extended byorg.mmbase.bridge.jsp.taglib.typehandler.AbstractTypeHandler
      extended byorg.mmbase.bridge.jsp.taglib.typehandler.DateHandler
All Implemented Interfaces:
TypeHandler

public class DateHandler
extends AbstractTypeHandler

Since:
MMBase-1.6
Version:
$Id: DateHandler.java,v 1.47 2006/07/08 13:04:47 michiel Exp $
Author:
Michiel Meeuwissen, Vincent vd Locht

Field Summary
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.typehandler.AbstractTypeHandler
eh, gotEnumHandler, tag
 
Constructor Summary
DateHandler(FieldInfoTag tag)
           
 
Method Summary
protected  int checkYear(int y, String fieldName)
          Just to override.
protected  Calendar getCalendarValue(Node node, Field field)
           
protected  Object getFieldValue(Field field)
          Returns the field value as specified by the client's post.
protected  Object getFieldValue(Node node, Field field, boolean useDefault)
          Returns the field value to be used in the page.
protected  DateTimePattern getPattern(DataType dt)
           
protected  Calendar getSpecifiedValue(Field field, Calendar cal)
           
 String htmlInput(Node node, Field field, boolean search)
          Produces an form input field for the given Node, and Field.
 void paramHtmlInput(ParamHandler handler, Field field)
           
 boolean useHtmlInput(Node node, Field field)
          returns true if setValue happened.
 String whereHtmlInput(Field field)
           
 Constraint whereHtmlInput(Field field, Query query)
          Adds search constraint to Query object.
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.typehandler.AbstractTypeHandler
addExtraAttributes, cast, checkHtmlInput, findString, getClasses, getEnumHandler, getOperator, getSearchValue, init, interpretEmptyAsNull, prefix, prefixError, prefixID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateHandler

public DateHandler(FieldInfoTag tag)
Parameters:
tag -
Method Detail

getPattern

protected DateTimePattern getPattern(DataType dt)
                              throws JspTagException
Throws:
JspTagException

getFieldValue

protected Object getFieldValue(Field field)
                        throws JspTagException
Returns the field value as specified by the client's post.

Overrides:
getFieldValue in class AbstractTypeHandler
Throws:
JspTagException

htmlInput

public String htmlInput(Node node,
                        Field field,
                        boolean search)
                 throws JspTagException
Description copied from interface: TypeHandler
Produces an form input field for the given Node, and Field.

Specified by:
htmlInput in interface TypeHandler
Overrides:
htmlInput in class AbstractTypeHandler
Throws:
JspTagException
See Also:
TypeHandler.htmlInput(Node, Field, boolean)

checkYear

protected int checkYear(int y,
                        String fieldName)
                 throws JspTagException
Just to override. For example if the date is stored in an int and not in a long, then the year can be checked.

Returns:
int
Throws:
JspTagException

useHtmlInput

public boolean useHtmlInput(Node node,
                            Field field)
                     throws JspTagException
Description copied from interface: TypeHandler
returns true if setValue happened.

Specified by:
useHtmlInput in interface TypeHandler
Overrides:
useHtmlInput in class AbstractTypeHandler
Throws:
JspTagException
See Also:
TypeHandler.useHtmlInput(Node, Field)

getSpecifiedValue

protected Calendar getSpecifiedValue(Field field,
                                     Calendar cal)
                              throws JspTagException
Returns:
The given Calendar instance or null
Throws:
JspTagException

getFieldValue

protected Object getFieldValue(Node node,
                               Field field,
                               boolean useDefault)
                        throws JspTagException
Description copied from class: AbstractTypeHandler
Returns the field value to be used in the page.

Overrides:
getFieldValue in class AbstractTypeHandler
Throws:
JspTagException

getCalendarValue

protected Calendar getCalendarValue(Node node,
                                    Field field)
                             throws JspTagException
Throws:
JspTagException

whereHtmlInput

public String whereHtmlInput(Field field)
                      throws JspTagException
Specified by:
whereHtmlInput in interface TypeHandler
Overrides:
whereHtmlInput in class AbstractTypeHandler
Throws:
JspTagException
See Also:
TypeHandler.whereHtmlInput(Field)

whereHtmlInput

public Constraint whereHtmlInput(Field field,
                                 Query query)
                          throws JspTagException
Description copied from class: AbstractTypeHandler
Adds search constraint to Query object.

Specified by:
whereHtmlInput in interface TypeHandler
Overrides:
whereHtmlInput in class AbstractTypeHandler
Returns:
null if nothing to be searched, the constraint if constraint added
Throws:
JspTagException

paramHtmlInput

public void paramHtmlInput(ParamHandler handler,
                           Field field)
                    throws JspTagException
Specified by:
paramHtmlInput in interface TypeHandler
Overrides:
paramHtmlInput in class AbstractTypeHandler
Throws:
JspTagException


MMBase build 1.8.1.20060716