org.apache.tika.parser.xml
Class AttributeDependantMetadataHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.tika.parser.xml.AttributeDependantMetadataHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class AttributeDependantMetadataHandler
extends org.xml.sax.helpers.DefaultHandler

This adds a Metadata entry for a given node. The textual content of the node is used as the value, and the Metadata name is taken from an attribute, with a prefix if required.


Constructor Summary
AttributeDependantMetadataHandler(Metadata metadata, String nameHoldingAttribute, String namePrefix)
           
 
Method Summary
 void addMetadata(String value)
           
 void characters(char[] ch, int start, int length)
           
 void endElement(String uri, String localName, String name)
           
 void startElement(String uri, String localName, String name, Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeDependantMetadataHandler

public AttributeDependantMetadataHandler(Metadata metadata,
                                         String nameHoldingAttribute,
                                         String namePrefix)
Method Detail

addMetadata

public void addMetadata(String value)

endElement

public void endElement(String uri,
                       String localName,
                       String name)
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler

startElement

public void startElement(String uri,
                         String localName,
                         String name,
                         Attributes attributes)
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

characters

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


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.