| java.lang.Object org.apache.cocoon.faces.samples.carstore.CreditCardConverter
CreditCardConverter | public class CreditCardConverter implements Converter(Code) | | CreditCardConverter Class accepts a Credit Card Number of type String
and strips blanks and "-" if any from it. It also formats the
CreditCardNumber such a blank space separates every four characters.
Blanks and "-" characters are the expected demiliters
that could be used as part of a CreditCardNumber.
|
Method Summary | |
public Object | getAsObject(FacesContext context, UIComponent component, String newValue) Parses the CreditCardNumber and strips any blanks or "-"
characters from it. | public String | getAsString(FacesContext context, UIComponent component, Object value) Formats the value by inserting space after every four characters
for better readability if they don't already exist. |
CONVERSION_ERROR_MESSAGE_ID | final public static String CONVERSION_ERROR_MESSAGE_ID(Code) | | The message identifier of the Message to be created if
the conversion fails. The message format string for this
message may optionally include a {0} and
{1} placeholders, which
will be replaced by the object and value.
|
getAsObject | public Object getAsObject(FacesContext context, UIComponent component, String newValue) throws ConverterException(Code) | | Parses the CreditCardNumber and strips any blanks or "-"
characters from it.
|
getAsString | public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException(Code) | | Formats the value by inserting space after every four characters
for better readability if they don't already exist. In the process
converts any "-" characters into blanks for consistency.
|
|
|