public class TextDocument
extends java.lang.Object
TextBlock
s.Constructor and Description |
---|
TextDocument(java.util.List<TextBlock> textBlocks)
Creates a new
TextDocument with given TextBlock s, and no
title. |
TextDocument(java.lang.String title,
java.util.List<TextBlock> textBlocks)
Creates a new
TextDocument with given TextBlock s and
given title. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
debugString()
Returns detailed debugging information about the contained
TextBlock s. |
java.lang.String |
getContent()
Returns the
TextDocument 's content. |
java.lang.String |
getText(boolean includeContent,
boolean includeNonContent)
Returns the
TextDocument 's content, non-content or both |
java.util.List<TextBlock> |
getTextBlocks()
Returns the
TextBlock s of this document. |
java.lang.String |
getTitle()
Returns the "main" title for this document, or
null if no
such title has ben set. |
void |
setTitle(java.lang.String title)
Updates the "main" title for this document.
|
public TextDocument(java.util.List<TextBlock> textBlocks)
TextDocument
with given TextBlock
s, and no
title.textBlocks
- The text blocks of this document.public TextDocument(java.lang.String title, java.util.List<TextBlock> textBlocks)
TextDocument
with given TextBlock
s and
given title.title
- The "main" title for this text document.textBlocks
- The text blocks of this document.public java.util.List<TextBlock> getTextBlocks()
TextBlock
s of this document.TextBlock
s, in sequential order of appearance.public java.lang.String getTitle()
null
if no
such title has ben set.public void setTitle(java.lang.String title)
title
- public java.lang.String getContent()
TextDocument
's content.public java.lang.String getText(boolean includeContent, boolean includeNonContent)
TextDocument
's content, non-content or bothincludeContent
- Whether to include TextBlocks marked as "content".includeNonContent
- Whether to include TextBlocks marked as "non-content".public java.lang.String debugString()
TextBlock
s.