Class ElementMetadataHandler

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

public class ElementMetadataHandler extends DefaultHandler
SAX event handler that maps the contents of an XML element into a metadata field.
Since:
Apache Tika 0.10
  • Constructor Details

    • ElementMetadataHandler

      public ElementMetadataHandler(String uri, String localName, Metadata metadata, String name)
      Constructor for string metadata keys.
      Parameters:
      uri - the uri of the namespace of the element
      localName - the local name of the element
      metadata - the Tika metadata object to populate
      name - the Tika metadata field key
    • ElementMetadataHandler

      public ElementMetadataHandler(String uri, String localName, Metadata metadata, String name, boolean allowDuplicateValues, boolean allowEmptyValues)
      Constructor for string metadata keys which allows change of behavior for duplicate and empty entry values.
      Parameters:
      uri - the uri of the namespace of the element
      localName - the local name of the element
      metadata - the Tika metadata object to populate
      name - the Tika metadata field key
      allowDuplicateValues - add duplicate values to the Tika metadata
      allowEmptyValues - add empty values to the Tika metadata
    • ElementMetadataHandler

      public ElementMetadataHandler(String uri, String localName, Metadata metadata, Property targetProperty)
      Constructor for Property metadata keys.
      Parameters:
      uri - the uri of the namespace of the element
      localName - the local name of the element
      metadata - the Tika metadata object to populate
      targetProperty - the Tika metadata Property key
    • ElementMetadataHandler

      public ElementMetadataHandler(String uri, String localName, Metadata metadata, Property targetProperty, boolean allowDuplicateValues, boolean allowEmptyValues)
      Constructor for Property metadata keys which allows change of behavior for duplicate and empty entry values.
      Parameters:
      uri - the uri of the namespace of the element
      localName - the local name of the element
      metadata - the Tika metadata object to populate
      targetProperty - the Tika metadata Property key
      allowDuplicateValues - add duplicate values to the Tika metadata
      allowEmptyValues - add empty values to the Tika metadata
  • Method Details