org.apache.taglibs.rdc
Class CreditCardAmount

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

public class CreditCardAmount
extends BaseModel

Datamodel for the credit card payment RDC. The amount value and the maximum and minimum values have an expected format of the form UUUmm.nn or mm.nn where UUU is the ISO 4217 currency code, mmm is integer part and nn is the fractional part. If currency code is not specified the default currency code for the default locale is assumed.

Author:
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_HIGHER_AMOUNT
          A constant for Error Code stating the currency entered is lower than allowed
static int ERR_NEED_LOWER_AMOUNT
          A constant for Error Code stating the currency entered is higher 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
CreditCardAmount()
          Sets default values for all data model members
 
Method Summary
protected  java.lang.Object canonicalize(java.lang.Object input, boolean isAttribute)
          Sets up maximum or minimum permissible value.
 java.lang.String getBalance()
          Return the account balance
 java.lang.String getCurrencyCode()
          Gets the currency code for the currency used
 java.lang.String getMaxAmount()
          Gets the maximum allowed amount for this payment
 int getMaxDenials()
          Get the maximum denials allowed before graceful exit
 java.lang.String getMinAmount()
          Gets the minimum allowed amount for this payment
 void setBalance(java.lang.String balance)
          Set the account balance
 void setConfirmed(java.lang.Boolean confirmed)
          Record user response to confirmation
 void setCurrencyCode(java.lang.String code)
          Sets the specified currency code
 void setFullAmountGrammar(Grammar g)
           
 void setMaxAmount(java.lang.String maxAmount)
          Sets the maximum allowed amount for this payment
 void setMaxDenials(int maxDenials)
          Set the maximum denials allowed before graceful exit
 void setMinAmount(java.lang.String minAmount)
          Sets the minimum allowed amount for this payment
 void setMinimumDueGrammar(Grammar g)
           
protected  java.lang.Boolean validate(java.lang.Object newValue, boolean setErrorCode)
          Validates the amount value 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, 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_LOWER_AMOUNT

public static final int ERR_NEED_LOWER_AMOUNT
A constant for Error Code stating the currency entered is higher than allowed

See Also:
Constant Field Values

ERR_NEED_HIGHER_AMOUNT

public static final int ERR_NEED_HIGHER_AMOUNT
A constant for Error Code stating the currency entered is lower than allowed

See Also:
Constant Field Values
Constructor Detail

CreditCardAmount

public CreditCardAmount()
Sets default values for all data model members

Method Detail

setMinimumDueGrammar

public void setMinimumDueGrammar(Grammar g)

setFullAmountGrammar

public void setFullAmountGrammar(Grammar g)

setConfirmed

public void setConfirmed(java.lang.Boolean confirmed)
Record user response to confirmation

Overrides:
setConfirmed in class BaseModel
Parameters:
confirmed - The user confirmation

getCurrencyCode

public java.lang.String getCurrencyCode()
Gets the currency code for the currency used

Returns:
The ISO 4217 currency code currently used

setCurrencyCode

public void setCurrencyCode(java.lang.String code)
Sets the specified currency code

Parameters:
code - The currency code as defined in ISO 4217 standards

getMaxAmount

public java.lang.String getMaxAmount()
Gets the maximum allowed amount for this payment

Returns:
the maximum allowed amount

setMaxAmount

public void setMaxAmount(java.lang.String maxAmount)
Sets the maximum allowed amount for this payment

Parameters:
maxAmount - The maximum allowed amount

getMinAmount

public java.lang.String getMinAmount()
Gets the minimum allowed amount for this payment

Returns:
the minimum allowed amount

setMinAmount

public void setMinAmount(java.lang.String minAmount)
Sets the minimum allowed amount for this payment

Parameters:
minAmount - The minimum allowed amount

getBalance

public java.lang.String getBalance()
Return the account balance

Returns:
Returns the balance

setBalance

public void setBalance(java.lang.String balance)
Set the account balance

Parameters:
balance - The balance to set.

getMaxDenials

public int getMaxDenials()
Get the maximum denials allowed before graceful exit

Returns:
Returns the maxDenials.

setMaxDenials

public void setMaxDenials(int maxDenials)
Set the maximum denials allowed before graceful exit

Parameters:
maxDenials - The maxDenials to set.

canonicalize

protected java.lang.Object canonicalize(java.lang.Object input,
                                        boolean isAttribute)
Sets up maximum or minimum permissible value. The format is UUUmm.nn or mm.nn. If value is in UUUmm.nn format the currency code UUU is ignored and the default currency code or the supplied currency code is assumed.

Overrides:
canonicalize in class BaseModel
Parameters:
strInput - The maximum or minimum amount, either in UUUmm.nn or mm.nn format
Returns:
formatted maximum or minimum value in mm.nn format

validate

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

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


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