Package org.apache.pdfbox.text
Class PDFTextStripper.PositionWrapper
- java.lang.Object
-
- org.apache.pdfbox.text.PDFTextStripper.PositionWrapper
-
- Enclosing class:
- PDFTextStripper
private static final class PDFTextStripper.PositionWrapper extends java.lang.Objectwrapper of TextPosition that adds flags to track status as linestart and paragraph start positions.This is implemented as a wrapper since the TextPosition class doesn't provide complete access to its state fields to subclasses. Also, conceptually TextPosition is immutable while these flags need to be set post-creation so it makes sense to put these flags in this separate class.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisArticleStartprivate booleanisHangingIndentprivate booleanisLineStartprivate booleanisPageBreakprivate booleanisParagraphStartprivate TextPositionposition
-
Constructor Summary
Constructors Constructor Description PositionWrapper(TextPosition position)Constructs a PositionWrapper around the specified TextPosition object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextPositiongetTextPosition()Returns the underlying TextPosition object.booleanisArticleStart()booleanisHangingIndent()booleanisLineStart()booleanisPageBreak()booleanisParagraphStart()voidsetArticleStart()Sets the isArticleStart() flag to true.voidsetHangingIndent()Sets the isHangingIndent() flag to true.voidsetLineStart()Sets the isLineStart() flag to true.voidsetPageBreak()Sets the isPageBreak() flag to true.voidsetParagraphStart()sets the isParagraphStart() flag to true.
-
-
-
Field Detail
-
isLineStart
private boolean isLineStart
-
isParagraphStart
private boolean isParagraphStart
-
isPageBreak
private boolean isPageBreak
-
isHangingIndent
private boolean isHangingIndent
-
isArticleStart
private boolean isArticleStart
-
position
private TextPosition position
-
-
Constructor Detail
-
PositionWrapper
PositionWrapper(TextPosition position)
Constructs a PositionWrapper around the specified TextPosition object.- Parameters:
position- the text position.
-
-
Method Detail
-
getTextPosition
public TextPosition getTextPosition()
Returns the underlying TextPosition object.- Returns:
- the text position
-
isLineStart
public boolean isLineStart()
-
setLineStart
public void setLineStart()
Sets the isLineStart() flag to true.
-
isParagraphStart
public boolean isParagraphStart()
-
setParagraphStart
public void setParagraphStart()
sets the isParagraphStart() flag to true.
-
isArticleStart
public boolean isArticleStart()
-
setArticleStart
public void setArticleStart()
Sets the isArticleStart() flag to true.
-
isPageBreak
public boolean isPageBreak()
-
setPageBreak
public void setPageBreak()
Sets the isPageBreak() flag to true.
-
isHangingIndent
public boolean isHangingIndent()
-
setHangingIndent
public void setHangingIndent()
Sets the isHangingIndent() flag to true.
-
-