public class Xml2TextHandler extends org.xml.sax.helpers.DefaultHandler
Modifier and Type | Field and Description |
---|---|
protected StringBuffer |
buf |
protected static SAXParserFactory |
factory |
protected SAXParser |
parser |
protected boolean |
trim |
Constructor and Description |
---|
Xml2TextHandler() |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endElement(String uri,
String localName,
String name) |
SAXParser |
getParser() |
String |
getText() |
String |
parse(File file) |
String |
parse(InputSource is) |
String |
parse(InputStream in) |
void |
startDocument() |
void |
startElement(String uri,
String localName,
String name,
Attributes attributes) |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
protected static final SAXParserFactory factory
protected StringBuffer buf
protected boolean trim
public Xml2TextHandler() throws SAXException, ParserConfigurationException
public String parse(File file) throws SAXException, IOException
SAXException
IOException
public String parse(InputStream in) throws SAXException, IOException
SAXException
IOException
public String parse(InputSource is) throws SAXException, IOException
SAXException
IOException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void endElement(String uri, String localName, String name) throws SAXException
endElement
in interface ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
SAXException
Copyright © 2015 Nuxeo SA. All rights reserved.