Class JsonStreamingSplitter
- java.lang.Object
-
- com.adaptris.core.services.splitter.MessageSplitterImp
-
- com.adaptris.core.json.streaming.JsonStreamingSplitter
-
- All Implemented Interfaces:
MessageSplitter
@ComponentProfile(since="3.8.2") public class JsonStreamingSplitter extends MessageSplitterImp
Splitter implementation that splits based on JSON streaming events.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 onXMLEventReader
and navigates based onStartElement
events only.In the adapter configuration file this class is aliased as json-streaming-splitter which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
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 JsonStreamingSplitter()
JsonStreamingSplitter(java.lang.String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
bufferSize()
java.lang.Integer
getBufferSize()
JsonStreamingConfigBuilder
getJsonStreamingConfig()
java.lang.String
getPath()
java.lang.Boolean
getSuppressPathNotFound()
java.lang.Boolean
getWrapWithArray()
void
setBufferSize(java.lang.Integer b)
Set the internal buffer size.void
setJsonStreamingConfig(JsonStreamingConfigBuilder jsonStreamingConfig)
void
setPath(java.lang.String path)
Set the xpath-alike path to the element on which you want to split.void
setSuppressPathNotFound(java.lang.Boolean suppressPathNotFound)
void
setWrapWithArray(java.lang.Boolean wrapWithArray)
java.lang.Iterable<AdaptrisMessage>
splitMessage(AdaptrisMessage msg)
protected boolean
wrapWithArray()
-
Methods inherited from class com.adaptris.core.services.splitter.MessageSplitterImp
copyMetadata, getCopyMetadata, getCopyObjectMetadata, getMessageFactory, selectFactory, setCopyMetadata, setCopyObjectMetadata, setMessageFactory
-
-
-
-
Method Detail
-
splitMessage
public java.lang.Iterable<AdaptrisMessage> splitMessage(AdaptrisMessage msg) throws CoreException
- Throws:
CoreException
-
getBufferSize
public java.lang.Integer getBufferSize()
-
setBufferSize
public void setBufferSize(java.lang.Integer b)
Set the internal buffer size.This is used when; the default buffer size matches the default buffer size in
BufferedReader
andBufferedWriter
, changes to the buffersize will impact performance and memory usage depending on the underlying operating system/disk.- Parameters:
b
- the buffer size (default is 8192).
-
bufferSize
protected int bufferSize()
-
getPath
public java.lang.String getPath()
-
setWrapWithArray
public void setWrapWithArray(java.lang.Boolean wrapWithArray)
-
getWrapWithArray
public java.lang.Boolean getWrapWithArray()
-
wrapWithArray
protected boolean wrapWithArray()
-
getSuppressPathNotFound
public java.lang.Boolean getSuppressPathNotFound()
-
setSuppressPathNotFound
public void setSuppressPathNotFound(java.lang.Boolean suppressPathNotFound)
-
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 onXMLEventReader
and navigates based onStartElement
events only.- Parameters:
path
- the path.
-
getJsonStreamingConfig
public JsonStreamingConfigBuilder getJsonStreamingConfig()
-
setJsonStreamingConfig
public void setJsonStreamingConfig(JsonStreamingConfigBuilder jsonStreamingConfig)
-
-