Package org.beanio.stream.json
Class JsonRecordMarshaller
- java.lang.Object
-
- org.beanio.stream.json.JsonWriterSupport
-
- org.beanio.stream.json.JsonRecordMarshaller
-
- All Implemented Interfaces:
RecordMarshaller
public class JsonRecordMarshaller extends JsonWriterSupport implements RecordMarshaller
ARecordMarshaller
implementation for JSON formatted records.- Since:
- 2.0
- See Also:
JsonRecordParserFactory
-
-
Constructor Summary
Constructors Constructor Description JsonRecordMarshaller()
Constructs a newJsonRecordMarshaller
.JsonRecordMarshaller(JsonParserConfiguration config)
Constructs a newJsonRecordMarshaller
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
marshal(java.lang.Object record)
Marshals a single record object to aString
.java.lang.String
marshal(java.util.Map<java.lang.String,java.lang.Object> map)
Marshals a single JSON object.-
Methods inherited from class org.beanio.stream.json.JsonWriterSupport
getIndent, getLineSeparator, init, isPretty, write, writeArray, writeString, writeValue
-
-
-
-
Constructor Detail
-
JsonRecordMarshaller
public JsonRecordMarshaller()
Constructs a newJsonRecordMarshaller
.
-
JsonRecordMarshaller
public JsonRecordMarshaller(JsonParserConfiguration config)
Constructs a newJsonRecordMarshaller
.- Parameters:
config
- theJsonParserConfiguration
-
-
Method Detail
-
marshal
public java.lang.String marshal(java.lang.Object record)
Description copied from interface:RecordMarshaller
Marshals a single record object to aString
.- Specified by:
marshal
in interfaceRecordMarshaller
- Parameters:
record
- the record object to marshal- Returns:
- the marshalled record text
-
marshal
public java.lang.String marshal(java.util.Map<java.lang.String,java.lang.Object> map)
Marshals a single JSON object.- Parameters:
map
- the JSON object to marshal- Returns:
- the JSON formatted text
-
-