Class LargeJsonArrayPathSplitter
- java.lang.Object
-
- com.adaptris.core.services.splitter.MessageSplitterImp
-
- com.adaptris.core.services.splitter.json.LargeJsonArraySplitter
-
- com.adaptris.core.services.splitter.json.LargeJsonArrayPathSplitter
-
- All Implemented Interfaces:
MessageSplitter
@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
Split an arbitrarily large JSON array.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 onJsonParser
and navigates based onJsonToken.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
LargeJsonArrayPathSplitter.PathGeneratorConfig
-
Nested classes/interfaces inherited from class com.adaptris.core.services.splitter.json.LargeJsonArraySplitter
LargeJsonArraySplitter.GeneratorConfig, LargeJsonArraySplitter.JsonSplitGenerator
-
Nested classes/interfaces inherited from class com.adaptris.core.services.splitter.MessageSplitterImp
MessageSplitterImp.SplitMessageIterator
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.splitter.MessageSplitterImp
logR
-
-
Constructor Summary
Constructors Constructor Description LargeJsonArrayPathSplitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
Methods inherited from class com.adaptris.core.services.splitter.json.LargeJsonArraySplitter
createSplitter, getBufferSize, setBufferSize, withBufferSize, withMessageFactory
-
Methods inherited from class com.adaptris.core.services.splitter.MessageSplitterImp
copyMetadata, getCopyMetadata, getCopyObjectMetadata, getMessageFactory, selectFactory, setCopyMetadata, setCopyObjectMetadata, setMessageFactory
-
-
-
-
Method Detail
-
getPath
public java.lang.String getPath()
-
setPath
public void setPath(java.lang.String path)
Set the xpath-alike path to the element on which you want to split.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 onJsonParser
and navigates based onJsonToken.START_OBJECT
events only.- Parameters:
path
- the path.
-
getSuppressPathNotFound
public java.lang.Boolean getSuppressPathNotFound()
-
setSuppressPathNotFound
public void setSuppressPathNotFound(java.lang.Boolean suppressPathNotFound)
-
getSuppressPathNotAnArray
public java.lang.Boolean getSuppressPathNotAnArray()
-
setSuppressPathNotAnArray
public void setSuppressPathNotAnArray(java.lang.Boolean suppressPathNotAnArray)
-
withPath
public LargeJsonArrayPathSplitter withPath(java.lang.String path)
-
withSuppressPathNotFound
public LargeJsonArrayPathSplitter withSuppressPathNotFound(boolean suppressPathNotFound)
-
withSuppressPathNotAnArray
public LargeJsonArrayPathSplitter withSuppressPathNotAnArray(boolean suppressPathNotAnArray)
-
splitMessage
public CloseableIterable<AdaptrisMessage> splitMessage(AdaptrisMessage msg) throws CoreException
- Specified by:
splitMessage
in interfaceMessageSplitter
- Overrides:
splitMessage
in classLargeJsonArraySplitter
- Throws:
CoreException
-
-