Package com.openhtmltopdf.bidi
Class ParagraphSplitter
java.lang.Object
com.openhtmltopdf.bidi.ParagraphSplitter
This class aims to split text into paragraphs where they can be passed to the
BidiSplitter. Each text node in the document is attached to the closest block-like element
which we assume paragraphs do not cross.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A fake paragraqph only supports manual BIDI classification.static class
A paragraph object collects the text of one paragraph. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List
<ParagraphSplitter.Paragraph> private Map
<Element, ParagraphSplitter.Paragraph> private Map
<Text, ParagraphSplitter.Paragraph> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte
convertDirectionIdent
(IdentValue ident) lookupBlockElement
(Element elem) lookupParagraph
(Text node) Get the paragraph object that a Text node is associated with.void
Run bidi splitting on the document's paragraphs.private void
splitParagraphs
(LayoutContext c, Node parent, ParagraphSplitter.Paragraph nearestBlock) Here we recursively split everything into paragraphs.void
splitRoot
(LayoutContext c, Document doc) This starts everything by recursively dividing the document into paragraphs.
-
Field Details
-
allParagraphs
-
paragraphs
-
blocks
-
-
Constructor Details
-
ParagraphSplitter
public ParagraphSplitter()
-
-
Method Details
-
convertDirectionIdent
-
lookupParagraph
Get the paragraph object that a Text node is associated with. Should never return null. -
lookupBlockElement
-
splitRoot
This starts everything by recursively dividing the document into paragraphs. -
runBidiOnParagraphs
Run bidi splitting on the document's paragraphs. -
splitParagraphs
private void splitParagraphs(LayoutContext c, Node parent, ParagraphSplitter.Paragraph nearestBlock) Here we recursively split everything into paragraphs.
-