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
public class AttributeMetadataHandler extends DefaultHandler
SAX event handler that maps the contents of an XML attribute into a metadata field.- Since:
- Apache Tika 0.10
-
-
Constructor Summary
Constructors Constructor Description AttributeMetadataHandler(String uri, String localName, Metadata metadata, String name)
AttributeMetadataHandler(String uri, String localName, Metadata metadata, Property property)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
-
-
-
-
Method Detail
-
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
protected void addMetadata(String value)
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
-
-