Package org.apache.tika.sax
Class ExpandedTitleContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.tika.sax.ContentHandlerDecorator
-
- org.apache.tika.sax.ExpandedTitleContentHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class ExpandedTitleContentHandler extends ContentHandlerDecorator
Content handler decorator which wraps aTransformerHandler
in order to allow theTITLE
tag to render as<title></title>
rather than<title/>
which is accomplished by calling theContentHandler.characters(char[], int, int)
method with alength
of 1 but a zero length char array.This workaround is an unfortunate circumstance of the limitations imposed by the implementation of the XML serialization code in the JDK brought over from the xalan project which no longer allows for the specification of an alternate
content-handler
via xslt templates or other means.- See Also:
- TIKA-725
-
-
Constructor Summary
Constructors Constructor Description ExpandedTitleContentHandler()
ExpandedTitleContentHandler(org.xml.sax.ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
void
startDocument()
void
startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, toString
-
-
-
-
Method Detail
-
startDocument
public void startDocument() throws org.xml.sax.SAXException
- Specified by:
startDocument
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startDocument
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Overrides:
characters
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
-