org.apache.tika.parser.xml
Class MetadataHandler

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

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

This adds Metadata entries with a specified name for the textual content of a node (if present), and all attribute values passed through the matcher (but not their names).


Constructor Summary
MetadataHandler(Metadata metadata, java.lang.String name)
           
 
Method Summary
 void addMetadata(java.lang.String value)
           
 void characters(char[] ch, int start, int length)
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.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

MetadataHandler

public MetadataHandler(Metadata metadata,
                       java.lang.String name)
Method Detail

addMetadata

public void addMetadata(java.lang.String value)

endElement

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

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes attributes)
Specified by:
startElement in interface org.xml.sax.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 org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler


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