Package com.openhtmltopdf.bidi
Class ParagraphSplitter
- java.lang.Object
-
- com.openhtmltopdf.bidi.ParagraphSplitter
-
public class ParagraphSplitter extends java.lang.ObjectThis 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 Classes Modifier and Type Class Description static classParagraphSplitter.FakeParagraphA fake paragraqph only supports manual BIDI classification.static classParagraphSplitter.ParagraphA paragraph object collects the text of one paragraph.
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ParagraphSplitter.Paragraph>allParagraphsprivate java.util.Map<org.w3c.dom.Element,ParagraphSplitter.Paragraph>blocksprivate java.util.Map<org.w3c.dom.Text,ParagraphSplitter.Paragraph>paragraphs
-
Constructor Summary
Constructors Constructor Description ParagraphSplitter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byteconvertDirectionIdent(IdentValue ident)ParagraphSplitter.ParagraphlookupBlockElement(org.w3c.dom.Element elem)ParagraphSplitter.ParagraphlookupParagraph(org.w3c.dom.Text node)Get the paragraph object that a Text node is associated with.voidrunBidiOnParagraphs(LayoutContext c)Run bidi splitting on the document's paragraphs.private voidsplitParagraphs(LayoutContext c, org.w3c.dom.Node parent, ParagraphSplitter.Paragraph nearestBlock)Here we recursively split everything into paragraphs.voidsplitRoot(LayoutContext c, org.w3c.dom.Document doc)This starts everything by recursively dividing the document into paragraphs.
-
-
-
Field Detail
-
allParagraphs
private java.util.List<ParagraphSplitter.Paragraph> allParagraphs
-
paragraphs
private java.util.Map<org.w3c.dom.Text,ParagraphSplitter.Paragraph> paragraphs
-
blocks
private java.util.Map<org.w3c.dom.Element,ParagraphSplitter.Paragraph> blocks
-
-
Method Detail
-
convertDirectionIdent
public static byte convertDirectionIdent(IdentValue ident)
-
lookupParagraph
public ParagraphSplitter.Paragraph lookupParagraph(org.w3c.dom.Text node)
Get the paragraph object that a Text node is associated with. Should never return null.
-
lookupBlockElement
public ParagraphSplitter.Paragraph lookupBlockElement(org.w3c.dom.Element elem)
-
splitRoot
public void splitRoot(LayoutContext c, org.w3c.dom.Document doc)
This starts everything by recursively dividing the document into paragraphs.
-
runBidiOnParagraphs
public void runBidiOnParagraphs(LayoutContext c)
Run bidi splitting on the document's paragraphs.
-
splitParagraphs
private void splitParagraphs(LayoutContext c, org.w3c.dom.Node parent, ParagraphSplitter.Paragraph nearestBlock)
Here we recursively split everything into paragraphs.
-
-