db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1309824 - in /db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om: FieldHelper.java OMForeignKeyTransformer.java OMTransformer.java
Date Thu, 05 Apr 2012 12:47:01 GMT
Author: tfischer
Date: Thu Apr  5 12:47:01 2012
New Revision: 1309824

URL: http://svn.apache.org/viewvc?rev=1309824&view=rev
Log:
checkstyle / javadoc

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/FieldHelper.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTransformer.java

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/FieldHelper.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/FieldHelper.java?rev=1309824&r1=1309823&r2=1309824&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/FieldHelper.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/FieldHelper.java
Thu Apr  5 12:47:01 2012
@@ -31,6 +31,13 @@ import org.apache.torque.templates.typem
  */
 final class FieldHelper
 {
+    /** Constant for get. */
+    private static final String GET = "get";
+    /** Constant for set. */
+    private static final String SET = "set";
+    /** Constant for is. */
+    private static final String IS = "is";
+
     /**
      * Private constructor for utility class.
      */
@@ -60,11 +67,11 @@ final class FieldHelper
                 TemplateOptionName.OM_USE_IS_FOR_BOOLEAN_GETTERS)
             && JavaType.BOOLEAN_PRIMITIVE.getClassName().equals(fieldType))
         {
-            getterName = "is" + StringUtils.capitalize(fieldName);
+            getterName = IS + StringUtils.capitalize(fieldName);
         }
         else
         {
-            getterName = "get" + StringUtils.capitalize(fieldName);
+            getterName = GET + StringUtils.capitalize(fieldName);
         }
         return getterName;
     }
@@ -79,7 +86,7 @@ final class FieldHelper
      */
     public static String getSetterName(String fieldName)
     {
-        String setterName = "set" + StringUtils.capitalize(fieldName);
+        String setterName = SET + StringUtils.capitalize(fieldName);
         return setterName;
     }
 
@@ -93,7 +100,8 @@ final class FieldHelper
      */
     public static String getFieldNameFromSetterName(String setterName)
     {
-        String fieldName = StringUtils.uncapitalize(setterName.substring(3));
+        String fieldName = StringUtils.uncapitalize(
+                setterName.substring(SET.length()));
         return fieldName;
     }
 

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java?rev=1309824&r1=1309823&r2=1309824&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMForeignKeyTransformer.java
Thu Apr  5 12:47:01 2012
@@ -798,8 +798,8 @@ public class OMForeignKeyTransformer
                         .getChild(TorqueSchemaElementName.COLUMN);
             foreignTableForeignKeyColumns.add(column);
         }
-        if (foreignTablePrimaryKeys.size() ==
-                foreignTableForeignKeyColumns.size())
+        if (foreignTablePrimaryKeys.size()
+                == foreignTableForeignKeyColumns.size())
         {
             referencesPrimaryKey = true;
             for (int i = 0; i < foreignTablePrimaryKeys.size(); ++i)

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTransformer.java?rev=1309824&r1=1309823&r2=1309824&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTransformer.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTransformer.java
Thu Apr  5 12:47:01 2012
@@ -41,8 +41,13 @@ import org.apache.torque.templates.trans
  * </ul>
  * No elements or attributes are deleted.
  *
- * TODO: add links to other transformers which are applied to certain elements
- *       of the source tree
+ * This transformer calls the following other transformers on the source tree:
+ * <ul>
+ *   <li>LoadExternalSchemaTransformer on the root node</li>
+ *   <li>OMTableAndViewTransformer on all tables and views</li>
+ *   <li>OMForeignKeyColumnTransformer on all columns</li>
+ *   <li>OMForeignKeyTransformer on all foreign keys (two passes)</li>
+ * <ul>
  *
  * $Id: $
  */



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message