public class ElementMetadataHandler extends org.xml.sax.helpers.DefaultHandler
Constructor and Description |
---|
ElementMetadataHandler(String uri,
String localName,
Metadata metadata,
Property targetProperty)
Constructor for Property metadata keys.
|
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.
|
ElementMetadataHandler(String uri,
String localName,
Metadata metadata,
String name)
Constructor for string metadata keys.
|
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.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMetadata(String value)
Adds the given metadata value.
|
void |
characters(char[] ch,
int start,
int length) |
void |
endElement(String uri,
String localName,
String name) |
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
protected boolean |
isMatchingElement(String uri,
String localName) |
protected boolean |
isMatchingParentElement(String uri,
String localName) |
void |
startElement(String uri,
String localName,
String name,
Attributes attributes) |
endDocument, endPrefixMapping, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
public ElementMetadataHandler(String uri, String localName, Metadata metadata, String name)
uri
- the uri of the namespace of the elementlocalName
- the local name of the elementmetadata
- the Tika metadata object to populatename
- the Tika metadata field keypublic ElementMetadataHandler(String uri, String localName, Metadata metadata, String name, boolean allowDuplicateValues, boolean allowEmptyValues)
uri
- the uri of the namespace of the elementlocalName
- the local name of the elementmetadata
- the Tika metadata object to populatename
- the Tika metadata field keyallowDuplicateValues
- add duplicate values to the Tika metadataallowEmptyValues
- add empty values to the Tika metadatapublic ElementMetadataHandler(String uri, String localName, Metadata metadata, Property targetProperty)
uri
- the uri of the namespace of the elementlocalName
- the local name of the elementmetadata
- the Tika metadata object to populatetargetProperty
- the Tika metadata Property keypublic ElementMetadataHandler(String uri, String localName, Metadata metadata, Property targetProperty, boolean allowDuplicateValues, boolean allowEmptyValues)
uri
- the uri of the namespace of the elementlocalName
- the local name of the elementmetadata
- the Tika metadata object to populatetargetProperty
- the Tika metadata Property keyallowDuplicateValues
- add duplicate values to the Tika metadataallowEmptyValues
- add empty values to the Tika metadatapublic void startElement(String uri, String localName, String name, Attributes attributes)
startElement
in interface ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
public void endElement(String uri, String localName, String name)
endElement
in interface ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
public void characters(char[] ch, int start, int length)
characters
in interface ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
public void ignorableWhitespace(char[] ch, int start, int length)
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.DefaultHandler
protected void addMetadata(String value)
null
or empty. If the metadata entry already exists,
then the given value is appended to it with a comma as the separator.value
- metadata valueCopyright © 2007-2015 The Apache Software Foundation. All Rights Reserved.