Package org.apache.poi.hssf.usermodel
Class HeaderFooter
java.lang.Object
org.apache.poi.hssf.usermodel.HeaderFooter
- All Implemented Interfaces:
HeaderFooter
- Direct Known Subclasses:
HSSFFooter,HSSFHeader
Common class for
HSSFHeader and HSSFFooter.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringdate()static StringendBold()static Stringstatic Stringstatic Stringfile()static Stringstatic StringfontSize(short size) final StringGet the center of the header or footer.final StringgetLeft()Get the left side of the header or footer.protected abstract Stringfinal StringgetRight()Get the right side of the header or footer.static StringnumPages()static Stringpage()final voidSets the center string.protected abstract voidsetHeaderFooterText(String text) final voidSets the left string.final voidSets the right string or footer.static Stringstatic Stringstatic Stringstatic StringstripFields(String pText) Removes any fields (eg macros, page markers etc) from the string.static Stringtab()static Stringtime()
-
Constructor Details
-
HeaderFooter
protected HeaderFooter()
-
-
Method Details
-
getRawText
- Returns:
- the internal text representation (combining center, left and right parts).
Possibly empty string if no header or footer is set. Never
null.
-
getLeft
Description copied from interface:HeaderFooterGet the left side of the header or footer.- Specified by:
getLeftin interfaceHeaderFooter- Returns:
- the left side of the header or footer.
-
setLeft
Description copied from interface:HeaderFooterSets the left string.- Specified by:
setLeftin interfaceHeaderFooter- Parameters:
newLeft- The string to set as the left side.
-
getCenter
Description copied from interface:HeaderFooterGet the center of the header or footer.- Specified by:
getCenterin interfaceHeaderFooter- Returns:
- the center of the header or footer.
-
setCenter
Description copied from interface:HeaderFooterSets the center string.- Specified by:
setCenterin interfaceHeaderFooter- Parameters:
newCenter- The string to set as the center.
-
getRight
Description copied from interface:HeaderFooterGet the right side of the header or footer.- Specified by:
getRightin interfaceHeaderFooter- Returns:
- The right side of the header or footer.
-
setRight
Description copied from interface:HeaderFooterSets the right string or footer.- Specified by:
setRightin interfaceHeaderFooter- Parameters:
newRight- The string to set as the right side.
-
fontSize
- Parameters:
size- the new font size- Returns:
- The mark-up tag representing a new font size
-
font
- Parameters:
font- the new fontstyle- the fonts style, one of regular, italic, bold, italic bold or bold italic- Returns:
- The mark-up tag representing a new font size
-
page
- Returns:
- The mark-up tag representing the current page number
-
numPages
- Returns:
- The mark-up tag representing the number of pages
-
date
- Returns:
- The mark-up tag representing the current date date
-
time
- Returns:
- The mark-up tag representing current time
-
file
- Returns:
- The mark-up tag representing the current file name
-
tab
- Returns:
- The mark-up tag representing the current tab (sheet) name
-
startBold
- Returns:
- The mark-up tag for start bold
-
endBold
- Returns:
- The mark-up tag for end bold
-
startUnderline
- Returns:
- The mark-up tag for start underline
-
endUnderline
- Returns:
- The mark-up tag for end underline
-
startDoubleUnderline
- Returns:
- The mark-up tag for start double underline
-
endDoubleUnderline
- Returns:
- The mark-up tag for end double underline
-
stripFields
Removes any fields (eg macros, page markers etc) from the string. Normally used to make some text suitable for showing to humans, and the resultant text should not normally be saved back into the document!
-