|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.odfdom.dom.DefaultElementVisitor
org.odftoolkit.odfdom.incubator.doc.text.OdfTextExtractor
org.odftoolkit.simple.common.TextExtractor
in Simple API.
public class OdfTextExtractor
It's a sub class of DefaultElementVisitor. It provides a method to get the display text of a single element.
If you pass the content root as the parameter, the whole document content will be returned, without any tag information.
It implements part of white space handling fuctions: text:p, text:h, text:s, text:tab, text:linebreak are processed according to ODF specification.
Field Summary | |
---|---|
protected StringBuilder |
mTextBuilder
Deprecated. |
protected static char |
NewLineChar
Deprecated. |
protected static char |
TabChar
Deprecated. |
Constructor Summary | |
---|---|
protected |
OdfTextExtractor()
Deprecated. Default constructor |
protected |
OdfTextExtractor(OdfElement element)
Deprecated. Constructor with an ODF element as paramter |
Method Summary | |
---|---|
protected void |
appendElementText(OdfElement ele)
Deprecated. Append the text content of this element to string buffer. |
String |
getText()
Deprecated. Return the text content as a string |
static OdfTextExtractor |
newOdfTextExtractor(OdfElement element)
Deprecated. An instance of OdfTextExtractor will be created to extract the text content of an ODF element. |
void |
visit(OdfElement element)
Deprecated. Visit odf element and process some operations |
void |
visit(TextHElement ele)
Deprecated. A method to visit "text:h" elements |
void |
visit(TextLineBreakElement ele)
Deprecated. A method to visit "text:line-break" elements |
void |
visit(TextPElement ele)
Deprecated. A method to visit "text:p" elements |
void |
visit(TextSElement ele)
Deprecated. A method to visit "text:s" elements |
void |
visit(TextTabElement ele)
Deprecated. A method to visit "text:tab" elements |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StringBuilder mTextBuilder
protected static final char NewLineChar
protected static final char TabChar
Constructor Detail |
---|
protected OdfTextExtractor()
protected OdfTextExtractor(OdfElement element)
element
- the ODF element whose text would be extracted.Method Detail |
---|
protected void appendElementText(OdfElement ele)
ele
- the ODF element whose text will be appended.public static OdfTextExtractor newOdfTextExtractor(OdfElement element)
element
- the ODF element whose text will be extracted.
public void visit(OdfElement element)
ElementVisitor
visit
in interface ElementVisitor
visit
in class DefaultElementVisitor
element
- ODF elementpublic void visit(TextPElement ele)
DefaultElementVisitor
visit
in class DefaultElementVisitor
ele
- - an instance of TextPElementpublic void visit(TextHElement ele)
DefaultElementVisitor
visit
in class DefaultElementVisitor
ele
- - an instance of TextHElementpublic void visit(TextSElement ele)
DefaultElementVisitor
visit
in class DefaultElementVisitor
ele
- - an instance of TextSElementpublic void visit(TextTabElement ele)
DefaultElementVisitor
visit
in class DefaultElementVisitor
ele
- - an instance of TextTabElementpublic void visit(TextLineBreakElement ele)
DefaultElementVisitor
visit
in class DefaultElementVisitor
ele
- - an instance of TextLineBreakElementpublic String getText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |