org.kuali.rice.kns.web.format
Class CurrencyFormatter

java.lang.Object
  extended by org.kuali.rice.kns.web.format.Formatter
      extended by org.kuali.rice.kns.web.format.CurrencyFormatter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
KualiIntegerCurrencyFormatter

public class CurrencyFormatter
extends Formatter

begin Kuali Foundation modification This class is used to format Currency objects. end Kuali Foundation modification

See Also:
Serialized Form

Field Summary
static String SHOW_SYMBOL
           
 
Fields inherited from class org.kuali.rice.kns.web.format.Formatter
propertyType, settings
 
Constructor Summary
CurrencyFormatter()
           
 
Method Summary
protected  Object convertToObject(String target)
          begin Kuali Foundation modification Unformats its argument and returns a KualiDecimal instance initialized with the resulting string value
 Object format(Object obj)
          Returns a string representation of its argument formatted as a currency value.
protected  String getSymbol()
           
protected  String interpolateSymbol(String target)
           
protected  String removeSymbol(String target)
           
protected  boolean showSymbol()
           
 boolean validate(String currencyString)
          Validates a currency string by passing it into the convertToObject method and determining if conversion succeeded.
 
Methods inherited from class org.kuali.rice.kns.web.format.Formatter
convertFromPresentationFormat, convertToArray, convertToCollection, findFormatter, formatArray, formatBean, formatCollection, formatForPresentation, formatNull, formatObject, formatterForType, getFormatter, getFormatter, getImplementationClass, getNullObjectValue, getPropertyType, getSettings, isBlank, isEmptyValue, isNullValue, isSupportedType, registerFormatter, setPropertyType, setSettings, trimString, unwrapString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHOW_SYMBOL

public static final String SHOW_SYMBOL
See Also:
Constant Field Values
Constructor Detail

CurrencyFormatter

public CurrencyFormatter()
Method Detail

convertToObject

protected Object convertToObject(String target)
begin Kuali Foundation modification Unformats its argument and returns a KualiDecimal instance initialized with the resulting string value

Overrides:
convertToObject in class Formatter
See Also:
end Kuali Foundation modification

interpolateSymbol

protected String interpolateSymbol(String target)

removeSymbol

protected String removeSymbol(String target)

getSymbol

protected String getSymbol()

showSymbol

protected boolean showSymbol()

format

public Object format(Object obj)
Returns a string representation of its argument formatted as a currency value. begin Kuali Foundation modification

Overrides:
format in class Formatter
See Also:
end Kuali Foundation modification

validate

public boolean validate(String currencyString)
Validates a currency string by passing it into the convertToObject method and determining if conversion succeeded.

Parameters:
currencyString - The string to attempt to format.
Returns:
True if no exceptions occurred when parsing and the conversion returned a non-null value; false otherwise.
See Also:
convertToObject(java.lang.String)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.