Which bit are you having trouble understanding?
Perhaps the sample HeaderFooterList will help. The guts of it:
Using java Syntax Highlighting
List
<SectionWrapper
> sectionWrappers
= wordMLPackage.
getDocumentModel().
getSections();
for (SectionWrapper sw
: sectionWrappers
) {
HeaderFooterPolicy hfp
= sw.
getHeaderFooterPolicy();
System.
out.
println("\n\nSECTION \n");
System.
out.
println("Headers:");
if (hfp.
getFirstHeader()!=null) System.
out.
println("-first");
if (hfp.
getDefaultHeader()!=null) System.
out.
println("-default");
if (hfp.
getEvenHeader()!=null) System.
out.
println("-even");
System.
out.
println("\nFooters:");
if (hfp.
getFirstFooter()!=null) System.
out.
println("-first");
if (hfp.
getDefaultFooter()!=null) System.
out.
println("-default");
if (hfp.
getEvenFooter()!=null) System.
out.
println("-even");
}
Parsed in 0.017 seconds, using
GeSHi 1.0.8.4
From the HeaderFooterPolicy object, you can get the relevant HeaderPart or FooterPart:
Using java Syntax Highlighting
public HeaderPart getFirstHeader
() {
return firstHeaderActive
;
}
public FooterPart getFirstFooter
() {
return firstFooterActive
;
}
/**
* Returns the odd page header. This is
* also the same as the default one...
*/
public HeaderPart getOddHeader
() {
return defaultHeader
;
}
/**
* Returns the odd page footer. This is
* also the same as the default one...
*/
public FooterPart getOddFooter
() {
return defaultFooter
;
}
public HeaderPart getEvenHeader
() {
return evenHeader
;
}
public FooterPart getEvenFooter
() {
return evenFooter
;
}
public HeaderPart getDefaultHeader
() {
return defaultHeader
;
}
public FooterPart getDefaultFooter
() {
return defaultFooter
;
}
Parsed in 0.014 seconds, using
GeSHi 1.0.8.4