Iterator i = pageViewport.getExtensionAttachments().iterator();
while (i.hasNext()) {
ExtensionAttachment attachment = (ExtensionAttachment)i.next();
if (AFPPageSetup.CATEGORY.equals(attachment.getCategory())) {
if (attachment instanceof AFPPageSetup) {
AFPPageSetup aps = (AFPPageSetup)attachment;
if (log.isDebugEnabled()) {
log.debug(aps);
}
String element = aps.getElementName();
if (AFPElementMapping.INCLUDE_PAGE_OVERLAY.equals(element)) {
String overlay = aps.getName();
if (overlay != null) {
_afpDataStream.createIncludePageOverlay(overlay);
}
} else if (AFPElementMapping.INCLUDE_PAGE_SEGMENT.equals(element)) {
String name = aps.getName();
String source = aps.getValue();
if (_pageSegmentsMap == null) {
_pageSegmentsMap = new HashMap();
}
_pageSegmentsMap.put(source, name);
} else if (AFPElementMapping.TAG_LOGICAL_ELEMENT.equals(element)) {
String name = aps.getName();
String value = aps.getValue();
if (_pageSegmentsMap == null) {
_pageSegmentsMap = new HashMap();
}
_afpDataStream.createTagLogicalElement(name, value);
} else if (AFPElementMapping.NO_OPERATION.equals(element)) {
String content = aps.getContent();
if (content != null) {
_afpDataStream.createNoOperation(content);
}
}
}