You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sk...@apache.org on 2005/06/09 10:05:40 UTC
svn commit: r189729 -
/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java
Author: skitching
Date: Thu Jun 9 01:05:39 2005
New Revision: 189729
URL: http://svn.apache.org/viewcvs?rev=189729&view=rev
Log:
Enhanced javadoc.
Modified:
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java
Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java?rev=189729&r1=189728&r2=189729&view=diff
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java (original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java Thu Jun 9 01:05:39 2005
@@ -23,10 +23,25 @@
/**
- * <p>Standard {@link Converter} implementation that converts an incoming
- * String into a <code>java.lang.String</code> object, optionally using a
- * default value or throwing a {@link ConversionException} if a conversion
- * error occurs.</p>
+ * Standard {@link Converter} implementation that converts an incoming
+ * object into a <code>java.lang.String</code> object.
+ * <p>
+ * Note that ConvertUtils really is designed to do string->object conversions,
+ * and offers very little support for object->string conversions. The
+ * ConvertUtils/ConvertUtilsBean methods only select a converter to apply
+ * based upon the target type being converted to, and generally assume that
+ * the input is a string (by calling its toString method if needed).
+ * <p>
+ * This class is therefore just a dummy converter that converts its input
+ * into a string by calling the input object's toString method and returning
+ * that value.
+ * <p>
+ * It is possible to replace this converter with something that has a big
+ * if/else statement that selects behaviour based on the real type of the
+ * object being converted (or possibly has a map of converters, and looks
+ * them up based on the class of the input object). However this is not part
+ * of the existing ConvertUtils framework.
+ *
*
* @author Craig R. McClanahan
* @version $Revision$ $Date$
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org