Class IFStructureTreeBuilder
- java.lang.Object
-
- org.apache.fop.render.intermediate.IFStructureTreeBuilder
-
- All Implemented Interfaces:
StructureTreeEventHandler
final class IFStructureTreeBuilder extends java.lang.Object implements StructureTreeEventHandler
Saves structure tree events as SAX events in order to replay them when it's time to stream the structure tree to the output.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classIFStructureTreeBuilder.IFStructureTreeElement(package private) static classIFStructureTreeBuilder.SAXEventRecorderA SAX handler that records events to replay them later.
-
Field Summary
Fields Modifier and Type Field Description private StructureTreeEventHandlerdelegateprivate intidCounterprivate java.util.List<IFStructureTreeBuilder.SAXEventRecorder>pageSequenceEventRecordersprivate IFStructureTreeBuilder.SAXEventRecorderretrievedMarkersEventRecorder
-
Constructor Summary
Constructors Constructor Description IFStructureTreeBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.xml.sax.helpers.AttributesImpladdIDAttribute(org.xml.sax.Attributes attributes, java.lang.String id)private org.xml.sax.helpers.AttributesImpladdParentAttribute(org.xml.sax.helpers.AttributesImpl attributes, StructureTreeElement parent)voidendNode(java.lang.String name)Ends a structure tree node.voidendPageSequence()Ends a page sequence structure tree node.private java.lang.StringgetNextID()private voidprepareRetrievedMarkersEventRecorder()voidreplayEventsForPageSequence(org.xml.sax.ContentHandler handler, int pageSequenceIndex)Replay SAX events for a page sequence.voidreplayEventsForRetrievedMarkers(org.xml.sax.ContentHandler handler)StructureTreeElementstartImageNode(java.lang.String name, org.xml.sax.Attributes attributes, StructureTreeElement parent)Starts an image node.StructureTreeElementstartNode(java.lang.String name, org.xml.sax.Attributes attributes, StructureTreeElement parent)Starts a structure tree node.voidstartPageSequence(java.util.Locale locale, java.lang.String role)Starts a page sequence structure tree node.StructureTreeElementstartReferencedNode(java.lang.String name, org.xml.sax.Attributes attributes, StructureTreeElement parent)Starts a node that can be referenced by other nodes.
-
-
-
Field Detail
-
delegate
private StructureTreeEventHandler delegate
-
pageSequenceEventRecorders
private final java.util.List<IFStructureTreeBuilder.SAXEventRecorder> pageSequenceEventRecorders
-
retrievedMarkersEventRecorder
private IFStructureTreeBuilder.SAXEventRecorder retrievedMarkersEventRecorder
-
idCounter
private int idCounter
-
-
Method Detail
-
replayEventsForPageSequence
public void replayEventsForPageSequence(org.xml.sax.ContentHandler handler, int pageSequenceIndex) throws org.xml.sax.SAXExceptionReplay SAX events for a page sequence.- Parameters:
handler- The handler that receives SAX eventspageSequenceIndex- The index of the page sequence- Throws:
org.xml.sax.SAXException
-
replayEventsForRetrievedMarkers
public void replayEventsForRetrievedMarkers(org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startPageSequence
public void startPageSequence(java.util.Locale locale, java.lang.String role)Description copied from interface:StructureTreeEventHandlerStarts a page sequence structure tree node.- Specified by:
startPageSequencein interfaceStructureTreeEventHandler- Parameters:
locale- The locale of the page sequencerole- the value of the role property. May be null.
-
endPageSequence
public void endPageSequence()
Description copied from interface:StructureTreeEventHandlerEnds a page sequence structure tree node.- Specified by:
endPageSequencein interfaceStructureTreeEventHandler
-
prepareRetrievedMarkersEventRecorder
private void prepareRetrievedMarkersEventRecorder()
-
startNode
public StructureTreeElement startNode(java.lang.String name, org.xml.sax.Attributes attributes, StructureTreeElement parent)
Description copied from interface:StructureTreeEventHandlerStarts a structure tree node.- Specified by:
startNodein interfaceStructureTreeEventHandler- Parameters:
name- the name of the structure tree nodeattributes- the node propertiesparent- the parent of the node. May be null, in which case the parent node is the node corresponding to the previous call to this method- Returns:
- the corresponding structure tree element
-
addParentAttribute
private org.xml.sax.helpers.AttributesImpl addParentAttribute(org.xml.sax.helpers.AttributesImpl attributes, StructureTreeElement parent)
-
endNode
public void endNode(java.lang.String name)
Description copied from interface:StructureTreeEventHandlerEnds a structure tree node.- Specified by:
endNodein interfaceStructureTreeEventHandler- Parameters:
name- the name of the structure tree node
-
startImageNode
public StructureTreeElement startImageNode(java.lang.String name, org.xml.sax.Attributes attributes, StructureTreeElement parent)
Description copied from interface:StructureTreeEventHandlerStarts an image node.- Specified by:
startImageNodein interfaceStructureTreeEventHandler- Parameters:
name- the name of the structure tree nodeattributes- the node propertiesparent- the parent of the node. May be null, in which case the parent node is the node corresponding to the previous call to this method- Returns:
- the corresponding structure tree element
-
startReferencedNode
public StructureTreeElement startReferencedNode(java.lang.String name, org.xml.sax.Attributes attributes, StructureTreeElement parent)
Description copied from interface:StructureTreeEventHandlerStarts a node that can be referenced by other nodes. This is usually a node that can have Marked Content References as children.- Specified by:
startReferencedNodein interfaceStructureTreeEventHandler- Parameters:
name- the name of the structure tree nodeattributes- the node propertiesparent- the parent of the node. May be null, in which case the parent node is the node corresponding to the previous call to this method- Returns:
- the corresponding structure tree element
-
getNextID
private java.lang.String getNextID()
-
addIDAttribute
private org.xml.sax.helpers.AttributesImpl addIDAttribute(org.xml.sax.Attributes attributes, java.lang.String id)
-
-