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:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class AttributeDependantMetadataHandler extends 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, String nameHoldingAttribute, String namePrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
Method Detail
-
addMetadata
public void addMetadata(String value)
-
endElement
public void endElement(String uri, String localName, String name)
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
-
startElement
public void startElement(String uri, String localName, String name, Attributes attributes)
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
-
characters
public void characters(char[] ch, int start, int length)
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
-
-