aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Vladimirov <sergey@apache.org>2011-09-21 15:33:29 +0000
committerSergey Vladimirov <sergey@apache.org>2011-09-21 15:33:29 +0000
commitb2213329e2e5f157d8a555814672bc98e7905c6f (patch)
tree4e0bb6bda0ffa6acdc45918ba9645d8bc5bcdc87
parent799ba60152d66b6b7385ec9363f64e8277791938 (diff)
downloadpoi-b2213329e2e5f157d8a555814672bc98e7905c6f.tar.gz
poi-b2213329e2e5f157d8a555814672bc98e7905c6f.zip
fix default values for byte[] fields in autogenerated files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1173719 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/types/styles/hdftype.xsl18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/types/styles/hdftype.xsl b/src/types/styles/hdftype.xsl
index ba8297e892..303433302c 100644
--- a/src/types/styles/hdftype.xsl
+++ b/src/types/styles/hdftype.xsl
@@ -90,6 +90,16 @@ public abstract class </xsl:text><xsl:value-of select="@name"/><xsl:text>Abstrac
<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:value-of select="@name"/><xsl:text>Abstrac
<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
*/