Title: [1155] trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java: remove DefaultJavaMethod.writeBody()
Revision
1155
Author
rfscholte
Date
2011-04-07 13:39:56 -0500 (Thu, 07 Apr 2011)

Log Message

remove DefaultJavaMethod.writeBody()

Modified Paths


Diff

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java (1154 => 1155)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java	2011-04-06 21:32:42 UTC (rev 1154)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java	2011-04-07 18:39:56 UTC (rev 1155)
@@ -75,91 +75,73 @@
      */
     private String getSignature( boolean withModifiers, boolean isDeclaration )
     {
-        IndentBuffer result = new IndentBuffer();
-        writeBody(result, withModifiers, isDeclaration, false);
-        return result.toString();
-    }
-
-
-    public String getDeclarationSignature( boolean withModifiers )
-    {
-        return getSignature(withModifiers, true);
-    }
-
-    public String getCallSignature()
-    {
-        return getSignature(false, false);
-    }
-
-    /**
-     * @since 1.3
-     */
-    protected void writeBody(IndentBuffer result, boolean withModifiers, boolean isDeclaration, boolean isPrettyPrint) {
-        if (withModifiers) {
-            for (String modifier : getModifiers()) {
-            	// check for public, protected and private
-                if (modifier.startsWith("p")) {
-                    result.write(modifier);
-                    result.write(' ');
+        StringBuffer result = new StringBuffer();
+        if ( withModifiers ) {
+            for ( String modifier : getModifiers() ) 
+            {
+                // check for public, protected and private
+                if ( modifier.startsWith( "p" ) ) {
+                    result.append( modifier ).append( ' ' );
                 }
             }
-            for (String modifier : getModifiers()) {
-            	// check for public, protected and private
-                if (!modifier.startsWith("p")) {
-                    result.write(modifier);
-                    result.write(' ');
+            for ( String modifier : getModifiers() ) 
+            {
+                // check for public, protected and private
+                if ( !modifier.startsWith( "p" ) ) 
+                {
+                    result.append( modifier ).append( ' ' );
                 }
             }
         }
 
         if(isDeclaration) {
-            result.write(returns.toString());
-            result.write(' ');
+            result.append(returns.toString());
+            result.append(' ');
         }
 
-        result.write(getName());
-        result.write('(');
+        result.append(getName());
+        result.append('(');
         for (ListIterator<JavaParameter> iter = getParameters().listIterator(); iter.hasNext();) {
             JavaParameter parameter = iter.next();
             if (isDeclaration) {
-                result.write(parameter.getType().toString());
+                result.append(parameter.getType().toString());
                 if (parameter.isVarArgs()) {
-                    result.write("...");
+                    result.append("...");
                 }
-                result.write(' ');
+                result.append(' ');
             }
-            result.write(parameter.getName());
+            result.append(parameter.getName());
             if (iter.hasNext()) 
             {
-                result.write(", ");
+                result.append(", ");
             }
         }
-        result.write(')');
+        result.append(')');
         if (isDeclaration) {
             if (exceptions.size() > 0) {
-                result.write(" throws ");
+                result.append(" throws ");
                 for(Iterator<Type> excIter = exceptions.iterator();excIter.hasNext();) {
-                    result.write(excIter.next().getValue());
+                    result.append(excIter.next().getValue());
                     if(excIter.hasNext()) {
-                        result.write(", ");
+                        result.append(", ");
                     }
                 }
             }
         }
-        if (isPrettyPrint) {
-            if (sourceCode != null && sourceCode.length() > 0) {
-                result.write(" {");
-                result.newline();
-                result.write(sourceCode);
-                result.write("}");
-                result.newline();
-            } else {
-                result.write(';');
-                result.newline();
-            }
-        }
+        return result.toString();
     }
 
+
+    public String getDeclarationSignature( boolean withModifiers )
+    {
+        return getSignature(withModifiers, true);
+    }
+
+    public String getCallSignature()
+    {
+        return getSignature(false, false);
+    }
+
     /**
      * Define the return type of this method
      * 


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to