poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1173719 - /poi/trunk/src/types/styles/hdftype.xsl
Date Wed, 21 Sep 2011 15:33:29 GMT
Author: sergey
Date: Wed Sep 21 15:33:29 2011
New Revision: 1173719

URL: http://svn.apache.org/viewvc?rev=1173719&view=rev
Log:
fix default values for byte[] fields in autogenerated files

Modified:
    poi/trunk/src/types/styles/hdftype.xsl

Modified: poi/trunk/src/types/styles/hdftype.xsl
URL: http://svn.apache.org/viewvc/poi/trunk/src/types/styles/hdftype.xsl?rev=1173719&r1=1173718&r2=1173719&view=diff
==============================================================================
--- poi/trunk/src/types/styles/hdftype.xsl (original)
+++ poi/trunk/src/types/styles/hdftype.xsl Wed Sep 21 15:33:29 2011
@@ -90,6 +90,16 @@ public abstract class </xsl:text><xsl:va
             <xsl:when test="@type='int'"/>
             <xsl:when test="@type='short'"/>
             <xsl:when test="@type='long'"/>
+            <xsl:when test="@type='byte[]'">
+                <xsl:call-template name="indent"/>
+                <xsl:call-template name="indent"/>
+                <xsl:text>this.</xsl:text>
+                <xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>
+                <xsl:text> = new byte[</xsl:text>
+                <xsl:value-of select="@size"/>
+                <xsl:text>];</xsl:text>
+                <xsl:call-template name="linebreak"/>
+            </xsl:when>
             <xsl:when test="substring(@type, string-length(@type) - 1) = '[]'">
                 <xsl:call-template name="indent"/>
                 <xsl:call-template name="indent"/>
@@ -153,6 +163,14 @@ public abstract class </xsl:text><xsl:va
     <xsl:text>}</xsl:text>
     <xsl:call-template name="linebreak"/>
     <xsl:text>
+    public byte[] serialize()
+    {
+        final byte[] result = new byte[ getSize() ];
+        serialize( result, 0 );
+        return result;
+    }
+</xsl:text>
+    <xsl:text>
     /**
      * Size of record
      */



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message