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 forHSSFHeader
andHSSFFooter
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HeaderFooter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static String
date()
static String
endBold()
static String
endDoubleUnderline()
static String
endUnderline()
static String
file()
static String
font(String font, String style)
static String
fontSize(short size)
String
getCenter()
Get the center of the header or footer.String
getLeft()
Get the left side of the header or footer.protected abstract String
getRawText()
String
getRight()
Get the right side of the header or footer.static String
numPages()
static String
page()
void
setCenter(String newCenter)
Sets the center string.protected abstract void
setHeaderFooterText(String text)
void
setLeft(String newLeft)
Sets the left string.void
setRight(String newRight)
Sets the right string or footer.static String
startBold()
static String
startDoubleUnderline()
static String
startUnderline()
static String
stripFields(String pText)
Removes any fields (eg macros, page markers etc) from the string.static String
tab()
static String
time()
-
-
-
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:HeaderFooter
Get the left side of the header or footer.- Specified by:
getLeft
in interfaceHeaderFooter
- Returns:
- the left side of the header or footer.
-
setLeft
public final void setLeft(String newLeft)
Description copied from interface:HeaderFooter
Sets the left string.- Specified by:
setLeft
in interfaceHeaderFooter
- Parameters:
newLeft
- The string to set as the left side.
-
getCenter
public final String getCenter()
Description copied from interface:HeaderFooter
Get the center of the header or footer.- Specified by:
getCenter
in interfaceHeaderFooter
- Returns:
- the center of the header or footer.
-
setCenter
public final void setCenter(String newCenter)
Description copied from interface:HeaderFooter
Sets the center string.- Specified by:
setCenter
in interfaceHeaderFooter
- Parameters:
newCenter
- The string to set as the center.
-
getRight
public final String getRight()
Description copied from interface:HeaderFooter
Get the right side of the header or footer.- Specified by:
getRight
in interfaceHeaderFooter
- Returns:
- The right side of the header or footer.
-
setRight
public final void setRight(String newRight)
Description copied from interface:HeaderFooter
Sets the right string or footer.- Specified by:
setRight
in 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
-
-