Package org.apache.poi.hssf.usermodel
Class HeaderFooter
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HeaderFooter
-
- All Implemented Interfaces:
HeaderFooter
- Direct Known Subclasses:
HSSFEvenFooter,HSSFEvenHeader,HSSFFirstFooter,HSSFFirstHeader,HSSFFooter,HSSFHeader
public abstract class HeaderFooter extends Object implements HeaderFooter
Common class forHSSFHeaderandHSSFFooter.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHeaderFooter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Stringdate()static StringendBold()static StringendDoubleUnderline()static StringendUnderline()static Stringfile()static Stringfont(String font, String style)static StringfontSize(short size)StringgetCenter()Get the center of the header or footer.StringgetLeft()Get the left side of the header or footer.protected abstract StringgetRawText()StringgetRight()Get the right side of the header or footer.static StringnumPages()static Stringpage()voidsetCenter(String newCenter)Sets the center string.protected abstract voidsetHeaderFooterText(String text)voidsetLeft(String newLeft)Sets the left string.voidsetRight(String newRight)Sets the right string or footer.static StringstartBold()static StringstartDoubleUnderline()static StringstartUnderline()static StringstripFields(String pText)Removes any fields (eg macros, page markers etc) from the string.static Stringtab()static Stringtime()
-
-
-
Method Detail
-
getRawText
protected abstract String 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
public final String 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
public final void setLeft(String newLeft)
Description copied from interface:HeaderFooterSets the left string.- Specified by:
setLeftin interfaceHeaderFooter- Parameters:
newLeft- The string to set as the left side.
-
getCenter
public final String 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
public final void setCenter(String newCenter)
Description copied from interface:HeaderFooterSets the center string.- Specified by:
setCenterin interfaceHeaderFooter- Parameters:
newCenter- The string to set as the center.
-
getRight
public final String 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
public final void setRight(String newRight)
Description copied from interface:HeaderFooterSets the right string or footer.- Specified by:
setRightin interfaceHeaderFooter- Parameters:
newRight- The string to set as the right side.
-
setHeaderFooterText
protected abstract void setHeaderFooterText(String text)
- Parameters:
text- the new header footer text (contains mark-up tags). Possibly empty string nevernull
-
fontSize
public static String fontSize(short size)
- Parameters:
size- the new font size- Returns:
- The mark-up tag representing a new font size
-
font
public static String font(String font, String style)
- 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
public static String page()
- Returns:
- The mark-up tag representing the current page number
-
numPages
public static String numPages()
- Returns:
- The mark-up tag representing the number of pages
-
date
public static String date()
- Returns:
- The mark-up tag representing the current date date
-
time
public static String time()
- Returns:
- The mark-up tag representing current time
-
file
public static String file()
- Returns:
- The mark-up tag representing the current file name
-
tab
public static String tab()
- Returns:
- The mark-up tag representing the current tab (sheet) name
-
startBold
public static String startBold()
- Returns:
- The mark-up tag for start bold
-
endBold
public static String endBold()
- Returns:
- The mark-up tag for end bold
-
startUnderline
public static String startUnderline()
- Returns:
- The mark-up tag for start underline
-
endUnderline
public static String endUnderline()
- Returns:
- The mark-up tag for end underline
-
startDoubleUnderline
public static String startDoubleUnderline()
- Returns:
- The mark-up tag for start double underline
-
endDoubleUnderline
public static String endDoubleUnderline()
- Returns:
- The mark-up tag for end double underline
-
-