org.apache.taglibs.rdc
Class SocialSecurityNumber

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

public class SocialSecurityNumber
extends BaseModel

Datamodel for the ssn (social security number) RDC. The ssn RDC is associated with the Social Security Number input and a pattern to which the input must conform. The SSN is a 9 digit number and should conform to this length.

Author:
Tanveer Faruquie, 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_SSN_CODE
          A constant for Error Code stating Invalid SSN
static int ERR_NEED_CORRECT_LENGTH_SSN_CODE
          A constant for Error Code stating the incorrect length of SSN
static int SSN_LENGTH
           
 
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
SocialSecurityNumber()
          Sets default values for all data members
 
Method Summary
 java.lang.String getPattern()
          Gets the pattern string
 void setPattern(java.lang.String pattern)
          Sets the pattern string to which the input must conform
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, canonicalize, 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_SSN_CODE

public static final int ERR_INVALID_SSN_CODE
A constant for Error Code stating Invalid SSN

See Also:
Constant Field Values

ERR_NEED_CORRECT_LENGTH_SSN_CODE

public static final int ERR_NEED_CORRECT_LENGTH_SSN_CODE
A constant for Error Code stating the incorrect length of SSN

See Also:
Constant Field Values

SSN_LENGTH

public static final int SSN_LENGTH
See Also:
Constant Field Values
Constructor Detail

SocialSecurityNumber

public SocialSecurityNumber()
Sets default values for all data members

Method Detail

setPattern

public void setPattern(java.lang.String pattern)
Sets the pattern string to which the input must conform

Parameters:
pattern - the pattern string to which the input must conform

getPattern

public java.lang.String getPattern()
Gets the pattern string

Returns:
the pattern string

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.