You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/09/21 17:33:29 UTC
svn commit: r1173719 - /poi/trunk/src/types/styles/hdftype.xsl
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