org.apache.taglibs.rdc
Class Number

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

public class Number
extends BaseModel

Datamodel for the number RDC. The number RDC will be associated with the number input and the maximum and minimum value within which the input's value must lie.

Author:
Sandeep Jindal, 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_NEED_LONGER_NUMBER
          A constant for Error Code stating the number entered is shorter than allowed
static int ERR_NEED_SHORTER_NUMBER
          A constant for Error Code stating the number entered is longer 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
Number()
          Sets default values for all data members
 
Method Summary
protected  java.lang.Object canonicalize(java.lang.Object newValue, boolean isAttribute)
          Custom canonicalization
 java.lang.String getMaxValue()
          Gets the maximum allowed value of number
 java.lang.String getMinValue()
          Gets the minimum allowed value of number
 void setMaxValue(java.lang.String maxValue)
          Sets the maximum allowed value of input
 void setMinValue(java.lang.String minValue)
          Sets the minimum allowed value
protected  java.lang.Boolean validate(java.lang.Object newValue, boolean setErrorCode)
          Validates the input against the given 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_NEED_SHORTER_NUMBER

public static final int ERR_NEED_SHORTER_NUMBER
A constant for Error Code stating the number entered is longer than allowed

See Also:
Constant Field Values

ERR_NEED_LONGER_NUMBER

public static final int ERR_NEED_LONGER_NUMBER
A constant for Error Code stating the number entered is shorter than allowed

See Also:
Constant Field Values
Constructor Detail

Number

public Number()
Sets default values for all data members

Method Detail

getMaxValue

public java.lang.String getMaxValue()
Gets the maximum allowed value of number

Returns:
The maximum allowed value of number

setMaxValue

public void setMaxValue(java.lang.String maxValue)
Sets the maximum allowed value of input

Parameters:
maxValue - the maximum allowed value of input

getMinValue

public java.lang.String getMinValue()
Gets the minimum allowed value of number

Returns:
The minimum allowed value of number

setMinValue

public void setMinValue(java.lang.String minValue)
Sets the minimum allowed value

Parameters:
minValue - the minimum allowed value of input

canonicalize

protected java.lang.Object canonicalize(java.lang.Object newValue,
                                        boolean isAttribute)
Custom canonicalization

Overrides:
canonicalize in class BaseModel
Parameters:
newValue - the value
Returns:
the canonicalized value

validate

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

Overrides:
validate in class BaseModel
Returns:
TRUE if valid, FALSE otherwise


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