Top Description Inners Constructors Methods
org.apache.poi.hssf.usermodel

public abstract Class HeaderFooter

extends Object
implements HeaderFooter
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.usermodel.HeaderFooter
Known Direct Subclasses
org.apache.poi.hssf.usermodel.HSSFFooter, org.apache.poi.hssf.usermodel.HSSFHeader

Common class for HSSFHeader and HSSFFooter.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

The mark-up tag representing the current date date
date
()

public static String

Returns:

The mark-up tag for end bold
endBold
()

public static String

Returns:

The mark-up tag for end double underline
endDoubleUnderline
()

public static String

Returns:

The mark-up tag for end underline
endUnderline
()

public static String

Returns:

The mark-up tag representing the current file name
file
()

public static String

Returns:

The mark-up tag representing a new font size
font
(String
the new font
font
,
String
the fonts style, one of regular, italic, bold, italic bold or bold italic
style
)

public static String

Returns:

The mark-up tag representing a new font size
fontSize
(short
the new font size
size
)

public final String

Returns:

the center of the header or footer.
getCenter
()

Implements org.apache.poi.ss.usermodel.HeaderFooter.getCenter.

Get the center of the header or footer.

public final String

Returns:

the left side of the header or footer.
getLeft
()

Implements org.apache.poi.ss.usermodel.HeaderFooter.getLeft.

Get the left side of the header or footer.

protected abstract String

Returns:

the internal text representation (combining center, left and right parts). Possibly empty string if no header or footer is set. Never null.
getRawText
()

public final String

Returns:

The right side of the header or footer.
getRight
()

Implements org.apache.poi.ss.usermodel.HeaderFooter.getRight.

Get the right side of the header or footer.

public static String

Returns:

The mark-up tag representing the number of pages
numPages
()

public static String

Returns:

The mark-up tag representing the current page number
page
()

public final void
setCenter(String
The string to set as the center.
newCenter
)

Implements org.apache.poi.ss.usermodel.HeaderFooter.setCenter.

Sets the center string.

protected abstract void
setHeaderFooterText(String
the new header footer text (contains mark-up tags). Possibly empty string never null
text
)

public final void
setLeft(String
The string to set as the left side.
newLeft
)

Implements org.apache.poi.ss.usermodel.HeaderFooter.setLeft.

Sets the left string.

public final void
setRight(String
The string to set as the right side.
newRight
)

Implements org.apache.poi.ss.usermodel.HeaderFooter.setRight.

Sets the right string or footer.

private String[]
public static String

Returns:

The mark-up tag for start bold
startBold
()

public static String

Returns:

The mark-up tag for start double underline
startDoubleUnderline
()

public static String

Returns:

The mark-up tag for start underline
startUnderline
()

public static String
stripFields(String pText)

Removes any fields (eg macros, page markers etc) from the string.

public static String

Returns:

The mark-up tag representing the current tab (sheet) name
tab
()

public static String

Returns:

The mark-up tag representing current time
time
()

private void
updateHeaderFooterText(String[] parts)

Creates the complete footer string based on the left, center, and middle strings.

private void
updatePart(int partIndex, String newValue)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

HeaderFooterback to summary
protected HeaderFooter()

Method Detail

dateback to summary
public static String date()
Returns:String

The mark-up tag representing the current date date

endBoldback to summary
public static String endBold()
Returns:String

The mark-up tag for end bold

endDoubleUnderlineback to summary
public static String endDoubleUnderline()
Returns:String

The mark-up tag for end double underline

endUnderlineback to summary
public static String endUnderline()
Returns:String

The mark-up tag for end underline

fileback to summary
public static String file()
Returns:String

The mark-up tag representing the current file name

fontback to summary
public static String font(String font, String style)
Parameters
font:String

the new font

style:String

the fonts style, one of regular, italic, bold, italic bold or bold italic

Returns:String

The mark-up tag representing a new font size

fontSizeback to summary
public static String fontSize(short size)
Parameters
size:short

the new font size

Returns:String

The mark-up tag representing a new font size

getCenterback to summary
public final String getCenter()

Implements org.apache.poi.ss.usermodel.HeaderFooter.getCenter.

Doc from org.apache.poi.ss.usermodel.HeaderFooter.getCenter.

Get the center of the header or footer.

Returns:String

the center of the header or footer.

getLeftback to summary
public final String getLeft()

Implements org.apache.poi.ss.usermodel.HeaderFooter.getLeft.

Doc from org.apache.poi.ss.usermodel.HeaderFooter.getLeft.

Get the left side of the header or footer.

Returns:String

the left side of the header or footer.

getRawTextback to summary
protected abstract String getRawText()
Returns:String

the internal text representation (combining center, left and right parts). Possibly empty string if no header or footer is set. Never null.

getRightback to summary
public final String getRight()

Implements org.apache.poi.ss.usermodel.HeaderFooter.getRight.

Doc from org.apache.poi.ss.usermodel.HeaderFooter.getRight.

Get the right side of the header or footer.

Returns:String

The right side of the header or footer.

numPagesback to summary
public static String numPages()
Returns:String

The mark-up tag representing the number of pages

pageback to summary
public static String page()
Returns:String

The mark-up tag representing the current page number

setCenterback to summary
public final void setCenter(String newCenter)

Implements org.apache.poi.ss.usermodel.HeaderFooter.setCenter.

Doc from org.apache.poi.ss.usermodel.HeaderFooter.setCenter.

Sets the center string.

Parameters
newCenter:String

The string to set as the center.

setHeaderFooterTextback to summary
protected abstract void setHeaderFooterText(String text)
Parameters
text:String

the new header footer text (contains mark-up tags). Possibly empty string never null

setLeftback to summary
public final void setLeft(String newLeft)

Implements org.apache.poi.ss.usermodel.HeaderFooter.setLeft.

Doc from org.apache.poi.ss.usermodel.HeaderFooter.setLeft.

Sets the left string.

Parameters
newLeft:String

The string to set as the left side.

setRightback to summary
public final void setRight(String newRight)

Implements org.apache.poi.ss.usermodel.HeaderFooter.setRight.

Doc from org.apache.poi.ss.usermodel.HeaderFooter.setRight.

Sets the right string or footer.

Parameters
newRight:String

The string to set as the right side.

splitPartsback to summary
private String[] splitParts()
startBoldback to summary
public static String startBold()
Returns:String

The mark-up tag for start bold

startDoubleUnderlineback to summary
public static String startDoubleUnderline()
Returns:String

The mark-up tag for start double underline

startUnderlineback to summary
public static String startUnderline()
Returns:String

The mark-up tag for start underline

stripFieldsback to summary
public static String stripFields(String pText)

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!

tabback to summary
public static String tab()
Returns:String

The mark-up tag representing the current tab (sheet) name

timeback to summary
public static String time()
Returns:String

The mark-up tag representing current time

updateHeaderFooterTextback to summary
private void updateHeaderFooterText(String[] parts)

Creates the complete footer string based on the left, center, and middle strings.

updatePartback to summary
private void updatePart(int partIndex, String newValue)
org.apache.poi.hssf.usermodel back to summary

private final Enum HeaderFooter.MarkupTag

extends Enum<HeaderFooter.MarkupTag>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final boolean
private final String
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag
public static final HeaderFooter.MarkupTag

Constructor Summary

AccessConstructor and Description
private
MarkupTag(String sequence, boolean occursInPairs)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The character sequence that marks this field
getRepresentation
()

public boolean

Returns:

true if this markup tag normally comes in a pair, eg turn on underline / turn off underline
occursPairs
()

public static HeaderFooter.MarkupTag
public static HeaderFooter.MarkupTag[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

_occursInPairsback to summary
private final boolean _occursInPairs
_representationback to summary
private final String _representation
BOLD_FIELDback to summary
public static final HeaderFooter.MarkupTag BOLD_FIELD
DATE_FIELDback to summary
public static final HeaderFooter.MarkupTag DATE_FIELD
DOUBLE_UNDERLINE_FIELDback to summary
public static final HeaderFooter.MarkupTag DOUBLE_UNDERLINE_FIELD
FILE_FIELDback to summary
public static final HeaderFooter.MarkupTag FILE_FIELD
FULL_FILE_FIELDback to summary
public static final HeaderFooter.MarkupTag FULL_FILE_FIELD
ITALIC_FIELDback to summary
public static final HeaderFooter.MarkupTag ITALIC_FIELD
NUM_PAGES_FIELDback to summary
public static final HeaderFooter.MarkupTag NUM_PAGES_FIELD
PAGE_FIELDback to summary
public static final HeaderFooter.MarkupTag PAGE_FIELD
PICTURE_FIELDback to summary
public static final HeaderFooter.MarkupTag PICTURE_FIELD
SHEET_NAME_FIELDback to summary
public static final HeaderFooter.MarkupTag SHEET_NAME_FIELD
STRIKETHROUGH_FIELDback to summary
public static final HeaderFooter.MarkupTag STRIKETHROUGH_FIELD
SUBSCRIPT_FIELDback to summary
public static final HeaderFooter.MarkupTag SUBSCRIPT_FIELD
SUPERSCRIPT_FIELDback to summary
public static final HeaderFooter.MarkupTag SUPERSCRIPT_FIELD
TIME_FIELDback to summary
public static final HeaderFooter.MarkupTag TIME_FIELD
UNDERLINE_FIELDback to summary
public static final HeaderFooter.MarkupTag UNDERLINE_FIELD

Constructor Detail

MarkupTagback to summary
private MarkupTag(String sequence, boolean occursInPairs)

Method Detail

getRepresentationback to summary
public String getRepresentation()
Returns:String

The character sequence that marks this field

occursPairsback to summary
public boolean occursPairs()
Returns:boolean

true if this markup tag normally comes in a pair, eg turn on underline / turn off underline

valueOfback to summary
public static HeaderFooter.MarkupTag valueOf(String name)
valuesback to summary
public static HeaderFooter.MarkupTag[] values()