public class RichTextHandler extends DefaultHandler
getValue()
to get parse string.Modifier and Type | Field and Description |
---|---|
protected static String[] |
__IGNORED_ELEMENTS
List of elements to be ignored during the body text retrieval processing
|
private static String |
__SEPARATOR |
private StringBuilder |
_bodyText |
private int |
_excerptLength |
private boolean |
_ignoreElmt |
private boolean |
_newElmt |
Constructor and Description |
---|
RichTextHandler()
Creates a rich text handler
|
RichTextHandler(int excerptLength)
Creates a rich text handler to parse a rich text with a limit a characters
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endElement(String uri,
String localName,
String qName) |
String |
getValue()
Gets the value of the parsed data
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes) |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
protected static final String[] __IGNORED_ELEMENTS
private static final String __SEPARATOR
private StringBuilder _bodyText
private boolean _ignoreElmt
private boolean _newElmt
private int _excerptLength
public RichTextHandler()
public RichTextHandler(int excerptLength)
excerptLength
- The length for content excerptpublic void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException