Search in sources :

Example 1 with MetadataHandler

use of org.apache.tika.parser.xml.MetadataHandler in project tika by apache.

the class OpenDocumentMetaParser method getMeta.

private static ContentHandler getMeta(ContentHandler ch, Metadata md, Property property, String element) {
    Matcher matcher = new CompositeMatcher(META_XPATH.parse("//meta:" + element), META_XPATH.parse("//meta:" + element + "//text()"));
    ContentHandler branch = new MatchingContentHandler(new MetadataHandler(md, property), matcher);
    return new TeeContentHandler(ch, branch);
}
Also used : CompositeMatcher(org.apache.tika.sax.xpath.CompositeMatcher) Matcher(org.apache.tika.sax.xpath.Matcher) MatchingContentHandler(org.apache.tika.sax.xpath.MatchingContentHandler) MetadataHandler(org.apache.tika.parser.xml.MetadataHandler) AttributeDependantMetadataHandler(org.apache.tika.parser.xml.AttributeDependantMetadataHandler) AttributeMetadataHandler(org.apache.tika.parser.xml.AttributeMetadataHandler) ElementMetadataHandler(org.apache.tika.parser.xml.ElementMetadataHandler) TeeContentHandler(org.apache.tika.sax.TeeContentHandler) MatchingContentHandler(org.apache.tika.sax.xpath.MatchingContentHandler) TeeContentHandler(org.apache.tika.sax.TeeContentHandler) ContentHandler(org.xml.sax.ContentHandler) CompositeMatcher(org.apache.tika.sax.xpath.CompositeMatcher)

Aggregations

AttributeDependantMetadataHandler (org.apache.tika.parser.xml.AttributeDependantMetadataHandler)1 AttributeMetadataHandler (org.apache.tika.parser.xml.AttributeMetadataHandler)1 ElementMetadataHandler (org.apache.tika.parser.xml.ElementMetadataHandler)1 MetadataHandler (org.apache.tika.parser.xml.MetadataHandler)1 TeeContentHandler (org.apache.tika.sax.TeeContentHandler)1 CompositeMatcher (org.apache.tika.sax.xpath.CompositeMatcher)1 Matcher (org.apache.tika.sax.xpath.Matcher)1 MatchingContentHandler (org.apache.tika.sax.xpath.MatchingContentHandler)1 ContentHandler (org.xml.sax.ContentHandler)1