if (marker == START) {
marker = 0;
// locate qualifying areas by 'marker-class-name' and
// 'retrieve-boundary'. Initially we will always check
// the containing page
Page containingPage = area.getPage();
bestMarker = searchPage(containingPage);
if (bestMarker != null) {
bestMarker.resetMarkerContent();
return bestMarker.layoutMarker(area);
}
// If marker not yet found, and 'retrieve-boundary' permits,
// search backward.
AreaTree areaTree = containingPage.getAreaTree();
if (retrieveBoundary == RetrieveBoundary.PAGE_SEQUENCE) {
PageSequence pageSequence = areaTree.getCurrentPageSequence();
if (pageSequence == containingPage.getPageSequence() ) {
return layoutBestMarker(areaTree.getCurrentPageSequenceMarkers(),area);
}
} else if (retrieveBoundary == RetrieveBoundary.DOCUMENT) {
return layoutBestMarker(areaTree.getDocumentMarkers(),area);
} else if (retrieveBoundary != RetrieveBoundary.PAGE) {