oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1483346 - /oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl
Date Thu, 16 May 2013 13:12:46 GMT
Author: simonetripodi
Date: Thu May 16 13:12:45 2013
New Revision: 1483346

URL: http://svn.apache.org/r1483346
Log:
generates the toString() method

Modified:
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl

Modified: oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl?rev=1483346&r1=1483345&r2=1483346&view=diff
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl (original)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl Thu May 16
13:12:45 2013
@@ -66,6 +66,29 @@ public final class <xsl:value-of select=
         return auxParameters;
     }
 
+    @Override
+    public String toString()
+    {
+        java.lang.StringBuilder builder = new java.lang.StringBuilder( " <xsl:value-of
select="@name" />[" )<xsl:apply-templates select="parameter" mode="toString" />;
+
+        int counter = 0;
+        for ( java.util.Map.Entry&lt;String, String&gt; auxParameter : auxParameters.entrySet()
)
+        {
+            if ( counter > 0 )
+            {
+                builder.append( ", " );
+            }
+
+            builder.append( auxParameter.getKey() )
+                   .append( ": " )
+                   .append( auxParameter.getValue() );
+
+            counter++;
+        }
+
+        return builder.append( "]" ).toString();
+    }
+
     /**
      * Hidden constructor, this class can not be instantiated directly.
      *
@@ -257,6 +280,11 @@ public final class <xsl:value-of select=
     }
 </xsl:template>
 
+  <xsl:template match="parameter" mode="toString">
+                                                       <xsl:if test="position() &gt;
1">.append( ", " )</xsl:if>
+                                                       .append( "<xsl:value-of select="@name"
/>: " )
+                                                       .append( <xsl:value-of select="@field"
/> )</xsl:template>
+
   <xsl:template match="parameter" mode="ctorArg">
     <xsl:if test="position() &gt; 1">, </xsl:if><xsl:value-of select="@type"
/><xsl:text> </xsl:text><xsl:value-of select="@field" />
   </xsl:template>



Mime
View raw message