|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler org.apache.tika.sax.ContentHandlerDecorator org.apache.tika.sax.SafeContentHandler org.apache.tika.sax.XHTMLContentHandler
public class XHTMLContentHandler
Content handler decorator that simplifies the task of producing XHTML events for Tika content parsers.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.tika.sax.SafeContentHandler |
---|
SafeContentHandler.Output |
Field Summary | |
---|---|
static Set<String> |
ENDLINE
The elements that get appended with the NL character. |
static String |
XHTML
The XHTML namespace URI |
Constructor Summary | |
---|---|
XHTMLContentHandler(ContentHandler handler,
Metadata metadata)
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
characters(String characters)
|
void |
element(String name,
String value)
Emits an XHTML element with the given text content. |
void |
endDocument()
Ends the XHTML document by writing the following footer and clearing the namespace mappings: |
void |
endElement(String name)
|
void |
endElement(String uri,
String local,
String name)
Ends the given element. |
void |
newline()
|
void |
startDocument()
Starts an XHTML document by setting up the namespace mappings. |
void |
startElement(String name)
|
void |
startElement(String name,
org.xml.sax.helpers.AttributesImpl attributes)
|
void |
startElement(String name,
String attribute,
String value)
|
void |
startElement(String uri,
String local,
String name,
Attributes attributes)
Starts the given element. |
Methods inherited from class org.apache.tika.sax.SafeContentHandler |
---|
ignorableWhitespace, isInvalid, writeReplacement |
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator |
---|
endPrefixMapping, handleException, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startPrefixMapping, toString |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String XHTML
public static final Set<String> ENDLINE
NL
character.
Constructor Detail |
---|
public XHTMLContentHandler(ContentHandler handler, Metadata metadata)
Method Detail |
---|
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class ContentHandlerDecorator
SAXException
public void endDocument() throws SAXException
</body> </html>
endDocument
in interface ContentHandler
endDocument
in class SafeContentHandler
SAXException
public void startElement(String uri, String local, String name, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class SafeContentHandler
SAXException
public void endElement(String uri, String local, String name) throws SAXException
endElement
in interface ContentHandler
endElement
in class SafeContentHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class SafeContentHandler
SAXException
public void startElement(String name) throws SAXException
SAXException
public void startElement(String name, String attribute, String value) throws SAXException
SAXException
public void startElement(String name, org.xml.sax.helpers.AttributesImpl attributes) throws SAXException
SAXException
public void endElement(String name) throws SAXException
SAXException
public void characters(String characters) throws SAXException
SAXException
public void newline() throws SAXException
SAXException
public void element(String name, String value) throws SAXException
name
- XHTML element namevalue
- element value, possibly null
SAXException
- if the content element could not be written
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |