org.apache.taglibs.rdc
Class Duration

java.lang.Object
  extended by org.apache.taglibs.rdc.core.BaseModel
      extended by org.apache.taglibs.rdc.Duration
All Implemented Interfaces:
java.io.Serializable

public class Duration
extends BaseModel

Datamodel for the duration RDC. The duration RDC will be associated with the duration input, the maximum and minimum duration within which the input's duration must lie, and a pattern to which the input must conform.

Author:
Sindhu Unnikrishnan, Rahul Akolkar
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.taglibs.rdc.core.BaseModel
BaseModel.ValueInterpreter
 
Field Summary
static int ERR_INVALID_DURATION
          A constant for Error Code stating Invalid duration
static int ERR_NEED_HIGHER_VALUE
          A constant for Error Code stating the duration entered is smaller than allowed
static int ERR_NEED_LOWER_VALUE
          A constant for Error Code stating the duration entered is larger 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
Duration()
          Sets default values for all data members
 
Method Summary
protected  java.lang.Object canonicalize(java.lang.Object input, boolean isAttribute)
          This method returns the full duration format if either partial duration is spoken or retuns full duration if input is full duration
 java.lang.String getMaxDuration()
          Gets the maximum Duration that a user has specified in the attirbute
 java.lang.String getMinDuration()
          Gets what minimum duration that a user has specified in the attirbute
 void setMaxDuration(java.lang.String maxDuration)
          Sets the maximum Duration value.
 void setMinDuration(java.lang.String minDuration)
          Sets the minimum duration 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, calculateCanonicalizedValue, 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, getValue, 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_DURATION

public static final int ERR_INVALID_DURATION
A constant for Error Code stating Invalid duration

See Also:
Constant Field Values

ERR_NEED_LOWER_VALUE

public static final int ERR_NEED_LOWER_VALUE
A constant for Error Code stating the duration entered is larger than allowed

See Also:
Constant Field Values

ERR_NEED_HIGHER_VALUE

public static final int ERR_NEED_HIGHER_VALUE
A constant for Error Code stating the duration entered is smaller than allowed

See Also:
Constant Field Values
Constructor Detail

Duration

public Duration()
Sets default values for all data members

Method Detail

getMaxDuration

public java.lang.String getMaxDuration()
Gets the maximum Duration that a user has specified in the attirbute

Returns:
the user specified maximum duration

setMaxDuration

public void setMaxDuration(java.lang.String maxDuration)
Sets the maximum Duration value.

Parameters:
maxDuration - The maximum duration value.

getMinDuration

public java.lang.String getMinDuration()
Gets what minimum duration that a user has specified in the attirbute

Returns:
the user specified minimum duration

setMinDuration

public void setMinDuration(java.lang.String minDuration)
Sets the minimum duration value.

Parameters:
minDuration - The minimum duration value.

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

canonicalize

protected java.lang.Object canonicalize(java.lang.Object input,
                                        boolean isAttribute)
This method returns the full duration format if either partial duration is spoken or retuns full duration if input is full duration

Overrides:
canonicalize in class BaseModel
Parameters:
input - The duration value(either partial or full)
Returns:
The full duration format


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.