|
||||||||||
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 java.util.Set<java.lang.String> |
ENDLINE
The elements that get appended with the NL character. |
static java.lang.String |
XHTML
The XHTML namespace URI |
Constructor Summary | |
---|---|
XHTMLContentHandler(org.xml.sax.ContentHandler handler,
Metadata metadata)
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
characters(java.lang.String characters)
|
void |
element(java.lang.String name,
java.lang.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(java.lang.String name)
|
void |
endElement(java.lang.String uri,
java.lang.String local,
java.lang.String name)
Ends the given element. |
void |
newline()
|
void |
startDocument()
Starts an XHTML document by setting up the namespace mappings. |
void |
startElement(java.lang.String name)
|
void |
startElement(java.lang.String name,
org.xml.sax.helpers.AttributesImpl attributes)
|
void |
startElement(java.lang.String name,
java.lang.String attribute,
java.lang.String value)
|
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String name,
org.xml.sax.Attributes attributes)
Starts the given element. |
Methods inherited from class org.apache.tika.sax.SafeContentHandler |
---|
ignorableWhitespace, isInvalid, 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 java.lang.String XHTML
public static final java.util.Set<java.lang.String> ENDLINE
NL
character.
Constructor Detail |
---|
public XHTMLContentHandler(org.xml.sax.ContentHandler handler, Metadata metadata)
Method Detail |
---|
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class ContentHandlerDecorator
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
</body> </html>
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class SafeContentHandler
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String local, java.lang.String name, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class SafeContentHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String local, java.lang.String name) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class SafeContentHandler
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class SafeContentHandler
org.xml.sax.SAXException
public void startElement(java.lang.String name) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startElement(java.lang.String name, java.lang.String attribute, java.lang.String value) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startElement(java.lang.String name, org.xml.sax.helpers.AttributesImpl attributes) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endElement(java.lang.String name) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void characters(java.lang.String characters) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void newline() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void element(java.lang.String name, java.lang.String value) throws org.xml.sax.SAXException
name
- XHTML element namevalue
- element value, possibly null
org.xml.sax.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 |