[displaytag-cvs] displaytag/src/main/java/org/displaytag/conversion PropertyConvertorFactory.java,1.
Brought to you by:
fgiust
|
From: fabrizio g. <fg...@us...> - 2005-10-16 20:35:01
|
Update of /cvsroot/displaytag/displaytag/src/main/java/org/displaytag/conversion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18315/src/main/java/org/displaytag/conversion Modified Files: PropertyConvertorFactory.java DefaultPropertyConvertor.java PropertyConvertor.java Log Message: committing DISPL-245 WYSIWYG Exports - from Jorge L. Barroso + some changes and fixes Index: PropertyConvertor.java =================================================================== RCS file: /cvsroot/displaytag/displaytag/src/main/java/org/displaytag/conversion/PropertyConvertor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PropertyConvertor.java 4 Jan 2005 22:34:43 -0000 1.1 --- PropertyConvertor.java 16 Oct 2005 20:34:38 -0000 1.2 *************** *** 1,8 **** package org.displaytag.conversion; - /** ! * The PropertyConvertor specifies the translation between a column value and a number. It is used for creating ! * totals. * @author rapruitt * @version $Revision$ ($Author$) --- 1,6 ---- package org.displaytag.conversion; /** ! * The PropertyConvertor specifies the translation between a column value and a number. It is used for creating totals. * @author rapruitt * @version $Revision$ ($Author$) *************** *** 14,18 **** * Convert this parameter to a Number. * @param value the value to convert ! * @return a Number the converted value */ Number asNumber(Object value); --- 12,16 ---- * Convert this parameter to a Number. * @param value the value to convert ! * @return a Number the converted value */ Number asNumber(Object value); Index: PropertyConvertorFactory.java =================================================================== RCS file: /cvsroot/displaytag/displaytag/src/main/java/org/displaytag/conversion/PropertyConvertorFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PropertyConvertorFactory.java 6 Jan 2005 19:53:02 -0000 1.2 --- PropertyConvertorFactory.java 16 Oct 2005 20:34:38 -0000 1.3 *************** *** 1,13 **** package org.displaytag.conversion; ! import org.displaytag.properties.TableProperties; ! import org.apache.commons.logging.Log; ! import org.apache.commons.logging.LogFactory; import org.apache.commons.beanutils.ConvertUtilsBean; import org.apache.commons.beanutils.Converter; import org.apache.commons.lang.StringUtils; ! ! import java.util.Map; ! import java.util.HashMap; --- 1,13 ---- package org.displaytag.conversion; ! import java.util.HashMap; ! import java.util.Map; ! import org.apache.commons.beanutils.ConvertUtilsBean; import org.apache.commons.beanutils.Converter; import org.apache.commons.lang.StringUtils; ! import org.apache.commons.logging.Log; ! import org.apache.commons.logging.LogFactory; ! import org.displaytag.properties.TableProperties; *************** *** 21,25 **** /** ! * The convert utils bean, with standard converters registered. */ private static ConvertUtilsBean defaultConvertorSource = new ConvertUtilsBean(); --- 21,25 ---- /** ! * The convert utils bean, with standard converters registered. */ private static ConvertUtilsBean defaultConvertorSource = new ConvertUtilsBean(); Index: DefaultPropertyConvertor.java =================================================================== RCS file: /cvsroot/displaytag/displaytag/src/main/java/org/displaytag/conversion/DefaultPropertyConvertor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DefaultPropertyConvertor.java 7 Apr 2005 00:53:38 -0000 1.3 --- DefaultPropertyConvertor.java 16 Oct 2005 20:34:38 -0000 1.4 *************** *** 1,12 **** package org.displaytag.conversion; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.apache.commons.beanutils.Converter; /** ! * A default implementation. Local PropertyConvertors are encouraged to subclass this class, and dispatch all but * special cases to super(). * @author rapruitt --- 1,12 ---- package org.displaytag.conversion; + import org.apache.commons.beanutils.Converter; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** ! * A default implementation. Local PropertyConvertors are encouraged to subclass this class, and dispatch all but * special cases to super(). * @author rapruitt *************** *** 15,18 **** --- 15,19 ---- public class DefaultPropertyConvertor implements Converter { + /** * logger. *************** *** 22,27 **** /** * Only handles Number; everything else is toString'd. ! * @param value the value ! * @param type the value -- must be Number * @return a Number; 0 if an error occurs in evaluation */ --- 23,28 ---- /** * Only handles Number; everything else is toString'd. ! * @param value the value ! * @param type the value -- must be Number * @return a Number; 0 if an error occurs in evaluation */ *************** *** 55,62 **** /** ! * This implementation is just a suggestion. It strips out some non-numeric characters; it is not ! * obviously not safe for most i18n currencies, etc. It is here for convenience when ! * this class is locally extended. ! * @param value the value to interpret * @return its value as a number */ --- 56,62 ---- /** ! * This implementation is just a suggestion. It strips out some non-numeric characters; it is not obviously not safe ! * for most i18n currencies, etc. It is here for convenience when this class is locally extended. ! * @param value the value to interpret * @return its value as a number */ *************** *** 72,77 **** { // It cannot be handled -- users should write a subclass if they are seeing this message.. ! log.warn("Cannot convert " + value + " to a number, " + e.getMessage() ! + " -- assuming a value of zero.", e); return new Double(0); } --- 72,79 ---- { // It cannot be handled -- users should write a subclass if they are seeing this message.. ! log ! .warn( ! "Cannot convert " + value + " to a number, " + e.getMessage() + " -- assuming a value of zero.", ! e); return new Double(0); } |