Package org.apache.tika.parser.xml
Class AttributeDependantMetadataHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.tika.parser.xml.AttributeDependantMetadataHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.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
Constructors Constructor Description AttributeDependantMetadataHandler(Metadata metadata, java.lang.String nameHoldingAttribute, java.lang.String namePrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
Constructor Detail
-
AttributeDependantMetadataHandler
public AttributeDependantMetadataHandler(Metadata metadata, java.lang.String nameHoldingAttribute, java.lang.String namePrefix)
-
-
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 interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.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 interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
-
characters
public void characters(char[] ch, int start, int length)
- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Overrides:
characters
in classorg.xml.sax.helpers.DefaultHandler
-
-