org.apache.taglibs.rdc
Class Date

java.lang.Object
  extended byorg.apache.taglibs.rdc.core.BaseModel
      extended byorg.apache.taglibs.rdc.Date
All Implemented Interfaces:
java.io.Serializable

public class Date
extends BaseModel

Datamodel for the date RDC. The date RDC will be associated with the date input, the maximum and minimum dates within which the date input must lie, and a date format to which the date input must conform.

Author:
Abhishek Verma, Rahul Akolkar
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.apache.taglibs.rdc.core.BaseModel
BaseModel.ValueInterpreter
 
Field Summary
static int ERR_INVALID_DATE
          A constant for Error Code stating Invalid date
static int ERR_NEED_EARLIER_DATE
          A constant for Error Code stating the date entered is later than allowed
static int ERR_NEED_LATER_DATE
          A constant for Error Code stating the date entered is earlier than allowed
 
Fields inherited from class org.apache.taglibs.rdc.core.BaseModel
ambiguousValues, candidates, canonicalizedValue, className, configuration, confirm, confirmed, DEFAULT_INITIAL_GRAMMAR_NAME, DEFAULT_MIN_CONFIDENCE, DEFAULT_NUM_N_BEST, echo, ERR_NO_DEFAULT, ERR_NONE, errorCode, exitStatus, grammars, id, initial, initialGrammar, interpretation, isAmbiguous, isValid, locale, maxNoInput, maxNoMatch, minConfidence, numNBest, paramsMap, PROPERTY_INITIAL_GRAMMAR, rdcLocale, rdcResourceBundle, skipSubmit, state, subdialog, submit, utterance, value
 
Constructor Summary
Date()
          Sets default values for all data members
 
Method Summary
protected  java.lang.String calculateCanonicalizedValue(java.lang.Object newValue)
          Builds a date string to be used for normalized output For e.g., 07082004 gets converted to July 8, 2004
protected  java.lang.Object canonicalize(java.lang.Object input, boolean isAttribute)
          Sets up the date string, converting phrases of today and tomorrow into valid dates followed by the format filter
 java.lang.String getMaxDate()
          Gets the Maximum Date value
 java.lang.String getMinDate()
          Gets the Minimum Date value
 java.lang.Object getValue()
          Get the date currently associated with this date component as a string in the specified format.
 void setFormat(java.lang.String strDateFormat)
          Sets the date string format to use for vaidation
 void setMaxDate(java.lang.String strMaxDate)
          Sets the Maximum Date value
 void setMinDate(java.lang.String strMinDate)
          Sets the Minimum Date value
protected  java.lang.Boolean validate(java.lang.Object newValue, boolean setErrorCode)
          Validates the received input against the validation constraints
 
Methods inherited from class org.apache.taglibs.rdc.core.BaseModel
baseCanonicalize, baseValidate, getAmbiguousValues, getCandidates, getCanonicalizedValue, getClassName, getConfiguration, getConfirm, getConfirmed, getEcho, getERR_NO_DEFAULT, getERR_NONE, getErrorCode, getExitStatus, getGrammars, getId, getInitial, getInterpretation, getIsAmbiguous, getIsValid, getLocale, getMaxNoInput, getMaxNoMatch, getMinConfidence, getNumNBest, getParamsMap, getRdcLocale, getRdcResourceBundle, getSerializedValue, getSkipSubmit, getState, getSubdialog, getSubmit, getUtterance, setAmbiguousValues, setCandidates, setCanonicalizedValue, setConfiguration, setConfirm, setConfirmed, setEcho, setErrorCode, setExitStatus, setGrammar, setId, setInitial, setInterpretation, setIsAmbiguous, setIsValid, setLocale, setMaxNoInput, setMaxNoMatch, setMinConfidence, setNumNBest, setSkipSubmit, setState, setSubdialog, setSubmit, setUtterance, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERR_INVALID_DATE

public static final int ERR_INVALID_DATE
A constant for Error Code stating Invalid date

See Also:
Constant Field Values

ERR_NEED_LATER_DATE

public static final int ERR_NEED_LATER_DATE
A constant for Error Code stating the date entered is earlier than allowed

See Also:
Constant Field Values

ERR_NEED_EARLIER_DATE

public static final int ERR_NEED_EARLIER_DATE
A constant for Error Code stating the date entered is later than allowed

See Also:
Constant Field Values
Constructor Detail

Date

public Date()
Sets default values for all data members

Method Detail

setFormat

public void setFormat(java.lang.String strDateFormat)
Sets the date string format to use for vaidation

Parameters:
strDateFormat - The date format string

setMaxDate

public void setMaxDate(java.lang.String strMaxDate)
Sets the Maximum Date value

Parameters:
strMaxDate - The Maximum Date value (conforms to format)

getMaxDate

public java.lang.String getMaxDate()
Gets the Maximum Date value

Returns:
The Maximum Date value

setMinDate

public void setMinDate(java.lang.String strMinDate)
Sets the Minimum Date value

Parameters:
strMinDate - The Minimum Date value (conforms to format)

getMinDate

public java.lang.String getMinDate()
Gets the Minimum Date value

Returns:
The Minimum Date value

getValue

public java.lang.Object getValue()
Get the date currently associated with this date component as a string in the specified format.

Overrides:
getValue in class BaseModel
Returns:
value the value as a string

canonicalize

protected java.lang.Object canonicalize(java.lang.Object input,
                                        boolean isAttribute)
Sets up the date string, converting phrases of today and tomorrow into valid dates followed by the format filter

Overrides:
canonicalize in class BaseModel
Parameters:
input - the value
Returns:
The value of date (conforming to format)

validate

protected java.lang.Boolean validate(java.lang.Object newValue,
                                     boolean setErrorCode)
Validates the received input against the validation constraints

Overrides:
validate in class BaseModel
Returns:
True if valid, False if invalid

calculateCanonicalizedValue

protected java.lang.String calculateCanonicalizedValue(java.lang.Object newValue)
Builds a date string to be used for normalized output For e.g., 07082004 gets converted to July 8, 2004

Overrides:
calculateCanonicalizedValue in class BaseModel
Returns:
The date string for date


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.