geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r780888 - in /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils: ConversionUtils.java HeaderParser.java
Date Mon, 01 Jun 2009 23:50:37 GMT
Author: gnodet
Date: Mon Jun  1 23:50:37 2009
New Revision: 780888

URL: http://svn.apache.org/viewvc?rev=780888&view=rev
Log:
Add some javadocs

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ConversionUtils.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/HeaderParser.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ConversionUtils.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ConversionUtils.java?rev=780888&r1=780887&r2=780888&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ConversionUtils.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/ConversionUtils.java
Mon Jun  1 23:50:37 2009
@@ -41,7 +41,7 @@
 import org.osgi.service.blueprint.container.Converter;
 
 /**
- * TODO: javadoc
+ * Utility class for conversions.
  *
  * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
  * @version $Rev: 767120 $, $Date: 2009-04-21 13:53:32 +0200 (Tue, 21 Apr 2009) $
@@ -50,11 +50,25 @@
 
     private ConversionUtils() { }
 
+    /**
+     * Objects implementing this interface will bypass the default conversion rules
+     * and be called directly to transform into the expected type.
+     */
     public static interface Convertible {
 
         Object convert(Type type) throws Exception;
     }
 
+    /**
+     * Convert an object.  This method will convert parameterized collections
+     * and arrays.
+     *
+     * @param obj the object to convert
+     * @param type the type to convert to
+     * @param converter the converter to apply
+     * @return the converted object
+     * @throws Exception if the object can not be converted
+     */
     public static Object convert(Object obj, Type type, Converter converter) throws Exception
{
         // First convert service proxies
         if (obj instanceof Convertible) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/HeaderParser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/HeaderParser.java?rev=780888&r1=780887&r2=780888&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/HeaderParser.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/HeaderParser.java
Mon Jun  1 23:50:37 2009
@@ -24,20 +24,26 @@
 import java.util.Map;
 
 /**
- * TODO: javadoc
+ * Utility class to parse a standard OSGi header with paths.
  *
  * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
  * @version $Rev$, $Date$
  */
 public class HeaderParser  {
-   
+
+    /**
+     * Parse a given OSGi header into a list of paths
+     *
+     * @param header the OSGi header to parse
+     * @return the list of paths extracted from this header
+     */
     public static List<PathElement> parseHeader(String header) {
         List<PathElement> elements = new ArrayList<PathElement>();
         String[] clauses = header.split(",");
         for (String clause : clauses) {
             String[] tokens = clause.split(";");
             if (tokens.length < 1) {
-                throw new RuntimeException("Invalid header clause: " + clause);
+                throw new IllegalArgumentException("Invalid header clause: " + clause);
             }
             PathElement elem = new PathElement(tokens[0].trim());
             elements.add(elem);



Mime
View raw message