Package org.apache.tika.parser.xml
Class AttributeMetadataHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.tika.parser.xml.AttributeMetadataHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
SAX event handler that maps the contents of an XML attribute into
a metadata field.
- Since:
- Apache Tika 0.10
-
Constructor Summary
ConstructorDescriptionAttributeMetadataHandler
(String uri, String localName, Metadata metadata, String name) AttributeMetadataHandler
(String uri, String localName, Metadata metadata, Property property) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addMetadata
(String value) Adds the given metadata value.void
startElement
(String uri, String localName, String qName, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
Constructor Details
-
AttributeMetadataHandler
-
AttributeMetadataHandler
-
-
Method Details
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
addMetadata
Adds the given metadata value. The value is ignored if it isnull
or empty. If the metadata entry already exists, then the given value is appended to it with a comma as the separator.- Parameters:
value
- metadata value
-