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
This commit is contained in:
Sergey Vladimirov 2011-09-21 15:33:29 +00:00
parent 56d27d0315
commit fb88976657

View File

@ -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='int'"/>
<xsl:when test="@type='short'"/> <xsl:when test="@type='short'"/>
<xsl:when test="@type='long'"/> <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:when test="substring(@type, string-length(@type) - 1) = '[]'">
<xsl:call-template name="indent"/> <xsl:call-template name="indent"/>
<xsl:call-template name="indent"/> <xsl:call-template name="indent"/>
@ -152,6 +162,14 @@ public abstract class </xsl:text><xsl:value-of select="@name"/><xsl:text>Abstrac
<xsl:call-template name="indent"/> <xsl:call-template name="indent"/>
<xsl:text>}</xsl:text> <xsl:text>}</xsl:text>
<xsl:call-template name="linebreak"/> <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> <xsl:text>
/** /**
* Size of record * Size of record