|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.droplet.CreditCardTagConverter
public class CreditCardTagConverter
This TagConverter can take an obnject that represents the number of a credit card and mask out parts of that number. This is used in display purposes where the users credit card should not be displayed to the screen. The following things can be configured for controlling what is masked out:
Here is an example of how to use this:
<valueof param="paymentGroup.creditCardNumber" CreditCard>no number</valueof>
<valueof param="paymentGroup.creditCardNumber" CreditCard maskCharacter="#" numCharsUnmasked="6" groupingSize="2">no number</valueof>
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
static java.lang.String |
NAME
|
Constructor Summary | |
---|---|
CreditCardTagConverter()
Empty Constructor |
Method Summary | |
---|---|
java.lang.String |
convertObjectToString(DynamoHttpServletRequest pRequest,
java.lang.Object pValue,
java.util.Properties pAttributes)
Convert the supplied credit card number to a string that is proper for displaying to the end user. |
java.lang.Object |
convertStringToObject(DynamoHttpServletRequest pRequest,
java.lang.String pValue,
java.util.Properties pAttributes)
This just ensures that if the property is required that it has been supplied. |
java.lang.String |
formatCreditCard(java.lang.Object pCreditCard,
java.util.Properties pAttributes)
Format and return the credit card object so that it is suitable for display to the end user. |
java.lang.Integer |
getGroupingSize()
|
java.lang.String |
getMaskChar()
|
java.lang.String |
getName()
Returns the name of this converter. |
java.lang.Integer |
getNumCharsUnmasked()
|
TagAttributeDescriptor[] |
getTagAttributeDescriptors()
Returns the list of TagAttributeDescriptors which are used by this converter. |
void |
setGroupingSize(java.lang.Integer pGroupingSize)
|
void |
setMaskChar(java.lang.String pMaskChar)
|
void |
setNumCharsUnmasked(java.lang.Integer pNumCharsUnmasked)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static final java.lang.String NAME
Constructor Detail |
---|
public CreditCardTagConverter()
Method Detail |
---|
public void setMaskChar(java.lang.String pMaskChar)
public java.lang.String getMaskChar()
public void setNumCharsUnmasked(java.lang.Integer pNumCharsUnmasked)
public java.lang.Integer getNumCharsUnmasked()
public void setGroupingSize(java.lang.Integer pGroupingSize)
public java.lang.Integer getGroupingSize()
public java.lang.String getName()
getName
in interface TagConverter
public TagAttributeDescriptor[] getTagAttributeDescriptors()
TagConverter
getTagAttributeDescriptors
in interface TagConverter
public java.lang.String convertObjectToString(DynamoHttpServletRequest pRequest, java.lang.Object pValue, java.util.Properties pAttributes) throws TagConversionException
The character tat is used to mask out all of the digits is optionally supplied, but defaults to an 'X'.
convertObjectToString
in interface TagConverter
pRequest
- a value of type 'DynamoHttpServletRequest'pValue
- a value of type 'Object'pAttributes
- a value of type 'Properties'
TagConversionException
- if an error occurspublic java.lang.Object convertStringToObject(DynamoHttpServletRequest pRequest, java.lang.String pValue, java.util.Properties pAttributes) throws TagConversionException
convertStringToObject
in interface TagConverter
pRequest
- the servlet request objectpValue
- the credit card numberpAttributes
- attributes passed in via jhtml
TagConversionException
- if an error occurspublic java.lang.String formatCreditCard(java.lang.Object pCreditCard, java.util.Properties pAttributes)
If more characters are being masked than there are to be masked, it will default to masking all characters. A space will be inserted after each grouping, by default every fourth character in the string returned.
pCreditCard
- an object that should represent the Credit Card numberpAttributes
- attributes passed into TagConverter via jhtml
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |