@ComponentProfile(summary="Split an arbitrarily large JSON array, with use of simple element traversal.", since="3.8.4", tag="json,splitting") public class LargeJsonArrayPathSplitter extends LargeJsonArraySplitter
This allows you to split via simple element traversal, so the path cannot be assumed to be an XPath.
/path/to/repeating/element
would be fine, but //repeating/element
would not. It works based on
JsonParser
and navigates based on JsonToken.START_OBJECT
events only.
Note: tested with an 85Mb file containing an array of >15k JSON objects
In the adapter configuration file this class is aliased as large-json-array-path-splitter which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
protected class |
LargeJsonArrayPathSplitter.PathGeneratorConfig |
LargeJsonArraySplitter.GeneratorConfig, LargeJsonArraySplitter.JsonSplitGenerator
MessageSplitterImp.SplitMessageIterator
logR
Constructor and Description |
---|
LargeJsonArrayPathSplitter() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getPath() |
java.lang.Boolean |
getSuppressPathNotAnArray() |
java.lang.Boolean |
getSuppressPathNotFound() |
void |
setPath(java.lang.String path)
Set the xpath-alike path to the element on which you want to split.
|
void |
setSuppressPathNotAnArray(java.lang.Boolean suppressPathNotAnArray) |
void |
setSuppressPathNotFound(java.lang.Boolean suppressPathNotFound) |
CloseableIterable<AdaptrisMessage> |
splitMessage(AdaptrisMessage msg) |
LargeJsonArrayPathSplitter |
withPath(java.lang.String path) |
LargeJsonArrayPathSplitter |
withSuppressPathNotAnArray(boolean suppressPathNotAnArray) |
LargeJsonArrayPathSplitter |
withSuppressPathNotFound(boolean suppressPathNotFound) |
createSplitter, getBufferSize, setBufferSize, withBufferSize, withMessageFactory
copyMetadata, getCopyMetadata, getCopyObjectMetadata, getMessageFactory, selectFactory, setCopyMetadata, setCopyObjectMetadata, setMessageFactory
public java.lang.String getPath()
public void setPath(java.lang.String path)
Note that this is only a pseudo-xpath evaluator as it only allows simple element traversal and not any XPath functions.
/path/to/repeating/element
would be fine, but //repeating/element
would not. It works based on
JsonParser
and navigates based on JsonToken.START_OBJECT
events only.
path
- the path.public java.lang.Boolean getSuppressPathNotFound()
public void setSuppressPathNotFound(java.lang.Boolean suppressPathNotFound)
public java.lang.Boolean getSuppressPathNotAnArray()
public void setSuppressPathNotAnArray(java.lang.Boolean suppressPathNotAnArray)
public LargeJsonArrayPathSplitter withPath(java.lang.String path)
public LargeJsonArrayPathSplitter withSuppressPathNotFound(boolean suppressPathNotFound)
public LargeJsonArrayPathSplitter withSuppressPathNotAnArray(boolean suppressPathNotAnArray)
public CloseableIterable<AdaptrisMessage> splitMessage(AdaptrisMessage msg) throws CoreException
splitMessage
in interface MessageSplitter
splitMessage
in class LargeJsonArraySplitter
CoreException