Package org.apache.poi.hssf.record
Class HeaderFooterRecord
- java.lang.Object
-
- org.apache.poi.hssf.record.RecordBase
-
- org.apache.poi.hssf.record.Record
-
- org.apache.poi.hssf.record.cont.ContinuableRecord
-
- org.apache.poi.hssf.record.HeaderFooterRecord
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
public final class HeaderFooterRecord extends ContinuableRecord
The HEADERFOOTER record stores information added in Office Excel 2007 for headers/footers.
-
-
Field Summary
Fields Modifier and Type Field Description static short
sid
-
Constructor Summary
Constructors Constructor Description HeaderFooterRecord()
HeaderFooterRecord(byte[] data)
HeaderFooterRecord(HeaderFooterRecord other)
HeaderFooterRecord(RecordInputStream in)
construct a HeaderFooterRecord record.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HeaderFooterRecord
copy()
String
getFooterEven()
String
getFooterFirst()
Map<String,Supplier<?>>
getGenericProperties()
HSSFRecordTypes
getGenericRecordType()
byte[]
getGuid()
If this header belongs to a specific sheet view , the sheet view?s GUID will be saved here.String
getHeaderEven()
String
getHeaderFirst()
short
getSid()
return the non static version of the id for this record.boolean
isAlignMargins()
Returns whether the left and right edges of the header and footer are lined up with the left and right margins of the sheet.boolean
isCurrentSheet()
boolean
isDiffFirst()
Returns whether the first page use a different header and footer.boolean
isDiffOddEven()
Returns whether the odd and even pages use a different header and footerboolean
isScaleWithDoc()
Returns whether the header and footer is scaled with the sheet.void
serialize(ContinuableRecordOutput out)
spit the record out AS IS.void
setAlignMargins(boolean flag)
void
setDiffFirst(boolean flag)
Sets whether the first page use a different header and footer.void
setDiffOddEven(boolean flag)
Set whether the odd and even pages use a different header and footer.void
setFooterEven(String str)
void
setFooterFirst(String str)
void
setHeaderEven(String str)
void
setHeaderFirst(String str)
void
setScaleWithDoc(boolean flag)
-
Methods inherited from class org.apache.poi.hssf.record.cont.ContinuableRecord
getRecordSize, serialize
-
Methods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, serialize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren
-
-
-
-
Field Detail
-
sid
public static final short sid
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HeaderFooterRecord
public HeaderFooterRecord()
-
HeaderFooterRecord
public HeaderFooterRecord(byte[] data)
-
HeaderFooterRecord
public HeaderFooterRecord(HeaderFooterRecord other)
-
HeaderFooterRecord
public HeaderFooterRecord(RecordInputStream in)
construct a HeaderFooterRecord record. No fields are interpreted and the record will be serialized in its original form more or less- Parameters:
in
- the RecordInputstream to read the record from
-
-
Method Detail
-
serialize
public void serialize(ContinuableRecordOutput out)
spit the record out AS IS. no interpretation or identification- Specified by:
serialize
in classContinuableRecord
- Parameters:
out
- a data output stream
-
getSid
public short getSid()
Description copied from class:Record
return the non static version of the id for this record.
-
getGuid
public byte[] getGuid()
If this header belongs to a specific sheet view , the sheet view?s GUID will be saved here.If it is zero, it means the current sheet. Otherwise, this field MUST match the guid field of the preceding
UserSViewBegin
record.- Returns:
- the sheet view?s GUID
-
isCurrentSheet
public boolean isCurrentSheet()
- Returns:
- whether this record belongs to the current sheet
-
copy
public HeaderFooterRecord copy()
- Specified by:
copy
in interfaceDuplicatable
- Specified by:
copy
in classRecord
- Returns:
- a deep copy of the implementing class / instance
-
getGenericRecordType
public HSSFRecordTypes getGenericRecordType()
- Specified by:
getGenericRecordType
in interfaceGenericRecord
- Specified by:
getGenericRecordType
in classRecord
-
isDiffOddEven
public boolean isDiffOddEven()
Returns whether the odd and even pages use a different header and footer
-
setDiffOddEven
public void setDiffOddEven(boolean flag)
Set whether the odd and even pages use a different header and footer. It has the side effect which will clear HeaderEven and FooterEven string if set to false.- Parameters:
flag
-
-
isDiffFirst
public boolean isDiffFirst()
Returns whether the first page use a different header and footer.
-
setDiffFirst
public void setDiffFirst(boolean flag)
Sets whether the first page use a different header and footer. It has the side effect which will clear HeaderFirst and FooterFirst string if set to false.- Parameters:
flag
-
-
isScaleWithDoc
public boolean isScaleWithDoc()
Returns whether the header and footer is scaled with the sheet.
-
setScaleWithDoc
public void setScaleWithDoc(boolean flag)
-
isAlignMargins
public boolean isAlignMargins()
Returns whether the left and right edges of the header and footer are lined up with the left and right margins of the sheet.
-
setAlignMargins
public void setAlignMargins(boolean flag)
-
getHeaderEven
public String getHeaderEven()
-
setHeaderEven
public void setHeaderEven(String str)
-
getFooterEven
public String getFooterEven()
-
setFooterEven
public void setFooterEven(String str)
-
getHeaderFirst
public String getHeaderFirst()
-
setHeaderFirst
public void setHeaderFirst(String str)
-
getFooterFirst
public String getFooterFirst()
-
setFooterFirst
public void setFooterFirst(String str)
-
-