Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,23 @@ public void startEmbeddedDocument(ContentHandler contentHandler, Metadata metada

/**
* This is called after parsing each embedded document. Override this
* for custom behavior. This is currently a no-op.
* for custom behavior. This is currently a no-op aside from tracking embedded depth.
* <p>
* When overriding, make sure to call {@link #decrementEmbeddedDepth()}
*
* @param contentHandler content handler that was used on this embedded document
* @param metadata metadata for this embedded document
* @throws SAXException
*/
public void endEmbeddedDocument(ContentHandler contentHandler, Metadata metadata)
throws SAXException {
embeddedDepth--;
decrementEmbeddedDepth();
}

/**
* This is called by RecursiveMetadataContentHandlerProxy as it
* cannot call endEmbeddedDocument().
* This is called by {@link #endEmbeddedDocument(ContentHandler, Metadata)}. Users
* overriding {@link #endEmbeddedDocument(ContentHandler, Metadata)} need to call this
* unless they are triggering it via <code>super.endEmbeddedDocument(contentHandler, metadata);</code>
*/
protected void decrementEmbeddedDepth() {
embeddedDepth--;
Expand Down