cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r439581 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types: DefaultType.java ExtendedTypeMap.java
Date Sat, 02 Sep 2006 12:33:48 GMT
Author: aadamchik
Date: Sat Sep  2 05:33:48 2006
New Revision: 439581

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

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/DefaultType.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/DefaultType.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/DefaultType.java?rev=439581&r1=439580&r2=439581&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/DefaultType.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/DefaultType.java
Sat Sep  2 05:33:48 2006
@@ -149,7 +149,7 @@
     protected Method procReadMethod;
 
     /**
-     * CreatesDefaultType to read objects from ResultSet using "getObject" method.
+     * Creates DefaultType to read objects from ResultSet using "getObject" method.
      */
     public DefaultType() {
         this.className = Object.class.getName();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java?rev=439581&r1=439580&r2=439581&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
Sat Sep  2 05:33:48 2006
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.access.types;
 
 import java.lang.reflect.Constructor;
@@ -33,14 +32,8 @@
 
 /**
  * Stores ExtendedTypes, implementing an algorithm to determine the right type for a given
- * Java class. When an ExtendedType is requested via a call to
- * {@link #getRegisteredType(String)}, ExtendedTypeMap returns the first type found,
- * using the following algorithm:
- * <ul>
- * <li>a type registered explicitly or implicitly for a given Java class name</li>
- * <li>a non-null type returned by a registered factory</li>
- * <li>default generic type.</li>
- * </ul>
+ * Java class. See {@link #getRegisteredType(String)} documentation for lookup algorith
+ * details.
  * 
  * @author Andrus Adamchik
  */
@@ -78,7 +71,7 @@
     protected void initDefaultTypes() {
         // void placeholder
         registerType(new VoidType());
-        
+
         // register default types
         Iterator it = DefaultType.defaultTypes();
         while (it.hasNext()) {
@@ -150,9 +143,19 @@
     }
 
     /**
-     * Returns a type registered for the class name. If no such type exists, returns the
-     * default type. It is guaranteed that this method returns a non-null ExtendedType
-     * instance. Note that for array types class name must be in the form 'MyClass[]'.
+     * Returns a guranteed non-null ExtendedType instance for a given Java class name. The
+     * following lookup sequence is used to determine the type:
+     * <ul>
+     * <li>First the methods checks for an ExtendedType explicitly registered with
the
+     * map for a given class name (most common types are registered by Cayenne internally;
+     * users can regsiter their own).</li>
+     * <li>Second, the method tries to obtain a type by iterating through registered
+     * {@link ExtendedTypeFactory} instances. If a factory returns a non-null type, it is
+     * returned to the user and the rest of the factories are ignored. </li>
+     * <li>If all the methods above failed, the default type is returned that relies
on
+     * default JDBC driver mapping to set and get objects.</li>
+     * </ul>
+     * <i>Note that for array types class name must be in the form 'MyClass[]'</i>.
      */
     public ExtendedType getRegisteredType(String javaClassName) {
         ExtendedType type = (ExtendedType) typeMap.get(javaClassName);



Mime
View raw message