commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adri...@apache.org
Subject svn commit: r923587 - in /commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert: Converters.java Util.java
Date Tue, 16 Mar 2010 05:51:19 GMT
Author: adrianc
Date: Tue Mar 16 05:51:19 2010
New Revision: 923587

URL: http://svn.apache.org/viewvc?rev=923587&view=rev
Log:
Added/edited javadoc comments.

Modified:
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Converters.java
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Converters.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Converters.java?rev=923587&r1=923586&r2=923587&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Converters.java
(original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Converters.java
Tue Mar 16 05:51:19 2010
@@ -27,7 +27,19 @@ import java.util.concurrent.ConcurrentHa
 
 import javax.imageio.spi.ServiceRegistry;
 
-/** A <code>Converter</code> factory and repository. */
+/** A <code>Converter</code> factory and utility class.
+ * <p>The factory loads {@link org.apache.commons.convert.Converter} instances
+ * via the Java service provider registry. Applications that need to extend the
+ * converter framework can do so by:<br />
+ * <ul>
+ * <li>Creating classes the implement the
+ * {@link org.apache.commons.convert.Converter} class</li>
+ * <li>Create a {@link org.apache.commons.convert.ConverterLoader} class that
+ * registers those classes</li>
+ * <li>Create a <code>META-INF/services/org.apache.commons.convert.ConverterLoader</code>
+ * file that contains the {@link org.apache.commons.convert.ConverterLoader} class name(s)</li>
+ * </ul></p>
+ */
 public class Converters {
     protected static final String DELIMITER = "->";
     protected static final ConcurrentHashMap<String, Converter<?, ?>> converterMap
= new ConcurrentHashMap<String, Converter<?, ?>>();
@@ -98,10 +110,11 @@ OUTER:
         return creater.createConverter(sourceClass, targetClass);
     }
 
-    /** Load all classes that implement <code>Converter</code> and are
+    /** Load all classes that implement {@link org.apache.commons.convert.Converter} and
are
      * contained in <code>containerClass</code>.
      *
-     * @param containerClass
+     * @param containerClass A class that contains {@link org.apache.commons.convert.Converter}
+     * implementations
      */
     public static void loadContainedConverters(Class<?> containerClass) {
         // This only returns -public- classes and interfaces

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java?rev=923587&r1=923586&r2=923587&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java (original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java Tue Mar
16 05:51:19 2010
@@ -21,6 +21,12 @@ package org.apache.commons.convert;
 /** Utility methods. */
 public class Util {
 
+    /** Convenience method to cast parameterized types.
+     * 
+     * @param <V> The type to cast to
+     * @param object The object to cast
+     * @return <code>obj</code> cast to type <code>T</code>
+     */
     @SuppressWarnings("unchecked")
     public static <V> V cast(Object object) {
         return (V) object;
@@ -55,6 +61,13 @@ public class Util {
         }
     }
 
+    /** Returns <code>true</code> if <code>str</code> is <code>null</code>
+     * or empty.
+     * 
+     * @param str The <code>String</code> to test
+     * @return <code>true</code> if <code>str</code> is <code>null</code>
+     * or empty
+     */
     public static boolean isEmpty(String str) {
         return str == null || str.trim().length() == 0;
     }



Mime
View raw message