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:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class ExpandedTitleContentHandler extends ContentHandlerDecorator
Content handler decorator which wraps aTransformerHandlerin order to allow theTITLEtag to render as<title></title>rather than<title/>which is accomplished by calling theContentHandler.characters(char[], int, int)method with alengthof 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-handlervia xslt templates or other means.- See Also:
- TIKA-725
-
-
Constructor Summary
Constructors Constructor Description ExpandedTitleContentHandler()ExpandedTitleContentHandler(ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)voidendElement(String uri, String localName, String qName)voidstartDocument()voidstartElement(String uri, String localName, String qName, Attributes atts)-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
endDocument, endPrefixMapping, error, fatalError, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startPrefixMapping, toString, warning
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
notationDecl, resolveEntity, unparsedEntityDecl
-
-
-
-
Constructor Detail
-
ExpandedTitleContentHandler
public ExpandedTitleContentHandler()
-
ExpandedTitleContentHandler
public ExpandedTitleContentHandler(ContentHandler handler)
-
-
Method Detail
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classContentHandlerDecorator- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classContentHandlerDecorator- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classContentHandlerDecorator- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classContentHandlerDecorator- Throws:
SAXException
-
-