Class EmbeddedConfig
- All Implemented Interfaces:
Serializable
For documents containing embedded documents (e.g. zip files), the default behavior of this treat them as a single document, merging all embedded documents content and metadata into the parent document. You can tell this parser to "split" embedded documents to have them treated as if they were individual documents. When split, each embedded documents will go through the entire import cycle, going through your handlers and even this parser again (just like any regular document would).
A container that was split is still a document of its own, with whatever
content it has itself (the body of an email, the text of a document that
holds pictures), and it goes on through your handlers and is committed like
any other. When it has none (a zip file, say), you may not want it:
list its content types with
setDiscardContainerContentTypes(List) to have it discarded once
its embedded documents were split off, which are not affected.
You can also decide to skip the parsing of embedded documents. Either by the content type of the parent document, or the content types of the embedded documents.
When embedded are being parsed, the resulting
ImporterResponse will contain nested documents, which in turn,
might contain some (tree-like structure).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanGets the content types of containers to discard, once split.intMaximum detph of embeded documents to extract.Gets the content types of container files to split and treat their embedded files as separate documents.Gets the content type matchers of container files you do not want to have their embedded files parsed.Gets the content types of container files to split and treat their embedded files as separate documents.inthashCode()setDiscardContainerContentTypes(List<TextMatcher> discardContainerContentTypes) Sets the content types of containers to discard, once split.setMaxEmbeddedDepth(int maxEmbeddedDepth) Maximum detph of embeded documents to extract.setSkipEmbeddedContentTypes(List<TextMatcher> skipEmbeddedContentTypes) Gets the content types of container files to split and treat their embedded files as separate documents.setSkipEmbeddedOfContentTypes(List<TextMatcher> skipEmbeddedOfContentTypes) Gets the content type matchers of container files you do not want to have their embedded files parsed.setSplitContentTypes(List<TextMatcher> splitContentTypes) Gets the content types of container files to split and treat their embedded files as separate documents.toString()
-
Constructor Details
-
EmbeddedConfig
public EmbeddedConfig()
-
-
Method Details
-
getDiscardContainerContentTypes
Gets the content types of containers to discard, once split. Only applies to a container that is split (seegetSplitContentTypes()) and that did hold embedded documents: the container is then discarded (rejected) and its embedded documents, which are documents of their own, carry on. A container of a type that is not split is merged with its embedded documents and is never discarded, whatever is set here. Each level is looked at on its own: a split container found inside a split container is discarded too if its type is listed.Default is to discard none: a split container is kept, as it always was.
- Returns:
- list of content type matcher
-
setDiscardContainerContentTypes
public EmbeddedConfig setDiscardContainerContentTypes(List<TextMatcher> discardContainerContentTypes) Sets the content types of containers to discard, once split. SeegetDiscardContainerContentTypes().- Parameters:
discardContainerContentTypes- list of content type matcher- Returns:
- this instance
-
getSplitContentTypes
Gets the content types of container files to split and treat their embedded files as separate documents. Default does not split any type (all embedded documents are merged).- Returns:
- list of content type matcher
-
setSplitContentTypes
Gets the content types of container files to split and treat their embedded files as separate documents. Default does not split any type (all embedded documents are merged).- Parameters:
splitContentTypes- list of content type matcher- Returns:
- this instance
-
getSkipEmbeddedOfContentTypes
Gets the content type matchers of container files you do not want to have their embedded files parsed. Embedded files of matching containers will effectively be skipped/ignored. Default parses embedded files of all container file content types.- Returns:
- list of content type matcher
-
setSkipEmbeddedOfContentTypes
Gets the content type matchers of container files you do not want to have their embedded files parsed. Embedded files of matching containers will effectively be skipped/ignored. Default parses embedded files of all container file content types.- Parameters:
skipEmbeddedOfContentTypes- list of content type matcher- Returns:
- this instance
-
getSkipEmbeddedContentTypes
Gets the content types of container files to split and treat their embedded files as separate documents. Default does not split any type (all embedded documents are merged).- Returns:
- list of content type matcher
-
setSkipEmbeddedContentTypes
Gets the content types of container files to split and treat their embedded files as separate documents. Default does not split any type (all embedded documents are merged).- Parameters:
skipEmbeddedContentTypes- list of content type matcher- Returns:
- this instance
-
getMaxEmbeddedDepth
public int getMaxEmbeddedDepth()Maximum detph of embeded documents to extract. Zero is the root document (original container).- Returns:
- maximum depth of embedded docs to extract
-
setMaxEmbeddedDepth
Maximum detph of embeded documents to extract. Zero is the root document (original container).- Parameters:
maxEmbeddedDepth- max depth or -1 (default) for unlimited.- Returns:
this.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-