org.ow2.weblab.service.normaliser.tika.handlers
Class SimpleTextContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.tika.sax.ContentHandlerDecorator
          extended by org.ow2.weblab.service.normaliser.tika.handlers.WebLabHandlerDecorator
              extended by org.ow2.weblab.service.normaliser.tika.handlers.SimpleTextContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class SimpleTextContentHandler
extends WebLabHandlerDecorator

This class is the simplest exemple of WebLab Handler Decorator. It creates a single Text unit with the concatenation of the HTML content in the Handler.

Author:
WebLab IPCC Team
Date:
2011-12-06

Constructor Summary
SimpleTextContentHandler()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
           
 void setDocument(Document document)
          Sets the document that should be enriched when processing the content with the handler.
 void setTikaConfiguration(TikaConfiguration tikaConfiguration)
          Sends the service configuration to this decorator.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes atts)
           
 
Methods inherited from class org.ow2.weblab.service.normaliser.tika.handlers.WebLabHandlerDecorator
setContentHandler
 
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
endDocument, endPrefixMapping, handleException, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, 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
 

Constructor Detail

SimpleTextContentHandler

public SimpleTextContentHandler()
Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class ContentHandlerDecorator
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String name)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class ContentHandlerDecorator
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class ContentHandlerDecorator
Throws:
org.xml.sax.SAXException

setDocument

public void setDocument(Document document)
Description copied from class: WebLabHandlerDecorator
Sets the document that should be enriched when processing the content with the handler.

Specified by:
setDocument in class WebLabHandlerDecorator
Parameters:
document - The WebLab document to be enriched

setTikaConfiguration

public void setTikaConfiguration(TikaConfiguration tikaConfiguration)
Description copied from class: WebLabHandlerDecorator
Sends the service configuration to this decorator. It will be called even if the configuration is not used inside.

Specified by:
setTikaConfiguration in class WebLabHandlerDecorator
Parameters:
tikaConfiguration - The service configuration


Copyright © 2004-2012. All Rights Reserved.