void addContent(ContentHandler handler, Metadata metadata) {

        if (handler.getClass().equals(DefaultHandler.class)) {
            //no-op: we can't rely on just testing for
            //empty content because DefaultHandler's toString()
            //returns e.g. "org.xml.sax.helpers.DefaultHandler@6c8b1edd"
        } else {
            String content = handler.toString();
            if (content != null && !content.isBlank()) {
                metadata.add(TikaCoreProperties.TIKA_CONTENT, content);
                metadata.add(TikaCoreProperties.TIKA_CONTENT_HANDLER,
                        handler.getClass().getSimpleName());
            }
        }
    }
@return a list of Metadata objects, one for the main document and one for each embedded
document
tika-core/src/main/java/org/apache/tika/sax/RecursiveParserWrapperHandler.java