aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Vladimirov <sergey@apache.org>2011-07-08 09:55:25 +0000
committerSergey Vladimirov <sergey@apache.org>2011-07-08 09:55:25 +0000
commit2c362974555bf16990d6fe336064245c1b927095 (patch)
tree3c8be5dd8ceab35d5a9a046f6306c3e992eec790
parent7e92ade6575e334bf28395454249d1f11d8cd229 (diff)
downloadpoi-2c362974555bf16990d6fe336064245c1b927095.tar.gz
poi-2c362974555bf16990d6fe336064245c1b927095.zip
make getSize() static
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144229 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java2
-rw-r--r--src/types/definitions/fld_type.out.xml300
-rw-r--r--src/types/styles/hdftype.xsl2
3 files changed, 2 insertions, 302 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java b/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java
index 34087512d7..b99a0edc34 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/model/types/FLDAbstractType.java
@@ -102,7 +102,7 @@ public abstract class FLDAbstractType implements HDFType
/**
* Size of record (exluding 4 byte header)
*/
- public int getSize()
+ public static int getSize()
{
return 4 + +1 + 1;
}
diff --git a/src/types/definitions/fld_type.out.xml b/src/types/definitions/fld_type.out.xml
deleted file mode 100644
index a852f1601b..0000000000
--- a/src/types/definitions/fld_type.out.xml
+++ /dev/null
@@ -1,300 +0,0 @@
-
-package org.apache.poi.hwpf.model.types;
-
-
-
-import org.apache.poi.util.BitField;
-import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.StringUtil;
-import org.apache.poi.util.HexDump;
-import org.apache.poi.hdf.model.hdftypes.HDFType;
-import org.apache.poi.hwpf.usermodel.*;
-
-/**
- * Field Descriptor (FLD). <p>Class and fields descriptions are
- quoted from
- Microsoft Office Word 97-2007 Binary File Format
-
- * NOTE: This source is automatically generated please do not modify this file. Either subclass or
- * remove the record in src/records/definitions.
-
- * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format
- Specification [*.doc]
-
- */
-public abstract class FLDAbstractType
- implements HDFType
-{
-
- protected char field_1_ch;
- protected byte field_2_flt;
- private static BitField fDiffer = new BitField(0x01);
- private static BitField fZombieEmbed = new BitField(0x02);
- private static BitField fResultDirty = new BitField(0x04);
- private static BitField fResultEdited = new BitField(0x08);
- private static BitField fLocked = new BitField(0x10);
- private static BitField fPrivateResult = new BitField(0x20);
- private static BitField fNested = new BitField(0x40);
- private static BitField fHasSep = new BitField(0x40);
-
-
- public FLDAbstractType()
- {
-
- }
-
- protected void fillFields(byte [] data, int offset)
- {
- field_1_ch = data[ 0x0 + offset ];
- field_2_flt = data[ 0x1 + offset ];
-
- }
-
- public void serialize(byte[] data, int offset)
- {
- data[ 0x0 + offset] = field_1_ch;;
- data[ 0x1 + offset] = field_2_flt;;
-
- }
-
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer();
-
- buffer.append("[FLD]\n");
-
- buffer.append(" .ch = ");
- buffer.append(" (").append(getCh()).append(" )\n");
-
- buffer.append(" .flt = ");
- buffer.append(" (").append(getFlt()).append(" )\n");
- buffer.append(" .fDiffer = ").append(isFDiffer()).append('\n');
- buffer.append(" .fZombieEmbed = ").append(isFZombieEmbed()).append('\n');
- buffer.append(" .fResultDirty = ").append(isFResultDirty()).append('\n');
- buffer.append(" .fResultEdited = ").append(isFResultEdited()).append('\n');
- buffer.append(" .fLocked = ").append(isFLocked()).append('\n');
- buffer.append(" .fPrivateResult = ").append(isFPrivateResult()).append('\n');
- buffer.append(" .fNested = ").append(isFNested()).append('\n');
- buffer.append(" .fHasSep = ").append(isFHasSep()).append('\n');
-
- buffer.append("[/FLD]\n");
- return buffer.toString();
- }
-
- /**
- * Size of record (exluding 4 byte header)
- */
- public int getSize()
- {
- return 4 + + 1 + 1;
- }
-
-
-
- /**
- * Type of field boundary the FLD describes: 19 -- field begin mark, 20 -- field separation mark; 21 -- field end mark.
- */
- public char getCh()
- {
- return field_1_ch;
- }
-
- /**
- * Type of field boundary the FLD describes: 19 -- field begin mark, 20 -- field separation mark; 21 -- field end mark.
- */
- public void setCh(char field_1_ch)
- {
- this.field_1_ch = field_1_ch;
- }
-
- /**
- * Field type when ch == 19 OR field flags when ch == 21 .
- */
- public byte getFlt()
- {
- return field_2_flt;
- }
-
- /**
- * Field type when ch == 19 OR field flags when ch == 21 .
- */
- public void setFlt(byte field_2_flt)
- {
- this.field_2_flt = field_2_flt;
- }
-
- /**
- * Sets the fDiffer field value.
- * Ignored for saved file
- */
- public void setFDiffer(boolean value)
- {
- field_2_flt = (byte)fDiffer.setBoolean(field_2_flt, value);
-
-
- }
-
- /**
- * Ignored for saved file
- * @return the fDiffer field value.
- */
- public boolean isFDiffer()
- {
- return fDiffer.isSet(field_2_flt);
-
- }
-
- /**
- * Sets the fZombieEmbed field value.
- * ==1 when result still believes this field is an EMBED or LINK field
- */
- public void setFZombieEmbed(boolean value)
- {
- field_2_flt = (byte)fZombieEmbed.setBoolean(field_2_flt, value);
-
-
- }
-
- /**
- * ==1 when result still believes this field is an EMBED or LINK field
- * @return the fZombieEmbed field value.
- */
- public boolean isFZombieEmbed()
- {
- return fZombieEmbed.isSet(field_2_flt);
-
- }
-
- /**
- * Sets the fResultDirty field value.
- * ==1 when user has edited or formatted the result. == 0 otherwise
- */
- public void setFResultDirty(boolean value)
- {
- field_2_flt = (byte)fResultDirty.setBoolean(field_2_flt, value);
-
-
- }
-
- /**
- * ==1 when user has edited or formatted the result. == 0 otherwise
- * @return the fResultDirty field value.
- */
- public boolean isFResultDirty()
- {
- return fResultDirty.isSet(field_2_flt);
-
- }
-
- /**
- * Sets the fResultEdited field value.
- * ==1 when user has inserted text into or deleted text from the result
- */
- public void setFResultEdited(boolean value)
- {
- field_2_flt = (byte)fResultEdited.setBoolean(field_2_flt, value);
-
-
- }
-
- /**
- * ==1 when user has inserted text into or deleted text from the result
- * @return the fResultEdited field value.
- */
- public boolean isFResultEdited()
- {
- return fResultEdited.isSet(field_2_flt);
-
- }
-
- /**
- * Sets the fLocked field value.
- * ==1 when field is locked from recalculation
- */
- public void setFLocked(boolean value)
- {
- field_2_flt = (byte)fLocked.setBoolean(field_2_flt, value);
-
-
- }
-
- /**
- * ==1 when field is locked from recalculation
- * @return the fLocked field value.
- */
- public boolean isFLocked()
- {
- return fLocked.isSet(field_2_flt);
-
- }
-
- /**
- * Sets the fPrivateResult field value.
- * ==1 whenever the result of the field is never to be shown
- */
- public void setFPrivateResult(boolean value)
- {
- field_2_flt = (byte)fPrivateResult.setBoolean(field_2_flt, value);
-
-
- }
-
- /**
- * ==1 whenever the result of the field is never to be shown
- * @return the fPrivateResult field value.
- */
- public boolean isFPrivateResult()
- {
- return fPrivateResult.isSet(field_2_flt);
-
- }
-
- /**
- * Sets the fNested field value.
- * ==1 when field is nested within another field
- */
- public void setFNested(boolean value)
- {
- field_2_flt = (byte)fNested.setBoolean(field_2_flt, value);
-
-
- }
-
- /**
- * ==1 when field is nested within another field
- * @return the fNested field value.
- */
- public boolean isFNested()
- {
- return fNested.isSet(field_2_flt);
-
- }
-
- /**
- * Sets the fHasSep field value.
- * ==1 when field has a field separator
- */
- public void setFHasSep(boolean value)
- {
- field_2_flt = (byte)fHasSep.setBoolean(field_2_flt, value);
-
-
- }
-
- /**
- * ==1 when field has a field separator
- * @return the fHasSep field value.
- */
- public boolean isFHasSep()
- {
- return fHasSep.isSet(field_2_flt);
-
- }
-
-
-} // END OF CLASS
-
-
-
-
diff --git a/src/types/styles/hdftype.xsl b/src/types/styles/hdftype.xsl
index f7be801880..6c9ab8cd52 100644
--- a/src/types/styles/hdftype.xsl
+++ b/src/types/styles/hdftype.xsl
@@ -91,7 +91,7 @@ public abstract class <xsl:value-of select="@name"/>AbstractType
/**
* Size of record (exluding 4 byte header)
*/
- public int getSize()
+ public static int getSize()
{
<xsl:variable name="fieldIterator" select="field:new()"/>
<xsl:text> return 4 + </xsl:text>