Class AutoArrayTarget
- java.lang.Object
-
- org.apache.synapse.commons.staxon.core.json.stream.util.AutoArrayTarget
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,JsonStreamTarget
public class AutoArrayTarget extends Object implements JsonStreamTarget
Target filter to auto-insert array boundaries. Note: this class caches all events and flushes to the underlying target after receiving the last close-object event, which may cause memory issues for large documents. Also, auto-recognition of array boundaries never creates arrays with a single element. It is recommended to handle array boundaries via theJsonXMLStreamWriter.writeStartArray(String)andJsonXMLStreamWriter.writeEndArray()methods or by producing<?xml-muliple ...?>processing instructions.
-
-
Constructor Summary
Constructors Constructor Description AutoArrayTarget(JsonStreamTarget delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidendArray()End array.voidendObject()End object.voidflush()voidname(String name)Write name.voidstartArray()Start array.voidstartObject()Start objectvoidvalue(Object value)Write value.
-
-
-
Constructor Detail
-
AutoArrayTarget
public AutoArrayTarget(JsonStreamTarget delegate)
-
-
Method Detail
-
name
public void name(String name) throws IOException
Description copied from interface:JsonStreamTargetWrite name.- Specified by:
namein interfaceJsonStreamTarget- Throws:
IOException
-
value
public void value(Object value) throws IOException
Description copied from interface:JsonStreamTargetWrite value.- Specified by:
valuein interfaceJsonStreamTarget- Throws:
IOException
-
startObject
public void startObject() throws IOExceptionDescription copied from interface:JsonStreamTargetStart object- Specified by:
startObjectin interfaceJsonStreamTarget- Throws:
IOException
-
endObject
public void endObject() throws IOExceptionDescription copied from interface:JsonStreamTargetEnd object.- Specified by:
endObjectin interfaceJsonStreamTarget- Throws:
IOException
-
startArray
public void startArray() throws IOExceptionDescription copied from interface:JsonStreamTargetStart array.- Specified by:
startArrayin interfaceJsonStreamTarget- Throws:
IOException
-
endArray
public void endArray() throws IOExceptionDescription copied from interface:JsonStreamTargetEnd array.- Specified by:
endArrayin interfaceJsonStreamTarget- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Throws:
IOException
-
-