BeanIO 2.0.4

org.beanio.stream.json
Class JsonRecordMarshaller

java.lang.Object
  extended by org.beanio.stream.json.JsonWriterSupport
      extended by org.beanio.stream.json.JsonRecordMarshaller
All Implemented Interfaces:
RecordMarshaller

public class JsonRecordMarshaller
extends JsonWriterSupport
implements RecordMarshaller

A RecordMarshaller implementation for JSON formatted records.

Since:
2.0
Author:
Kevin Seim
See Also:
JsonRecordParserFactory

Constructor Summary
JsonRecordMarshaller()
          Constructs a new JsonRecordMarshaller.
JsonRecordMarshaller(JsonParserConfiguration config)
          Constructs a new JsonRecordMarshaller.
 
Method Summary
 String marshal(Map<String,Object> map)
          Marshals a single JSON object.
 String marshal(Object record)
          Marshals a single record object to a String.
 
Methods inherited from class org.beanio.stream.json.JsonWriterSupport
getIndent, getLineSeparator, init, isPretty, write, writeArray, writeString, writeValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonRecordMarshaller

public JsonRecordMarshaller()
Constructs a new JsonRecordMarshaller.


JsonRecordMarshaller

public JsonRecordMarshaller(JsonParserConfiguration config)
Constructs a new JsonRecordMarshaller.

Parameters:
config - the JsonParserConfiguration
Method Detail

marshal

public String marshal(Object record)
Description copied from interface: RecordMarshaller
Marshals a single record object to a String.

Specified by:
marshal in interface RecordMarshaller
Parameters:
record - the record object to marshal
Returns:
the marshalled record text

marshal

public String marshal(Map<String,Object> map)
Marshals a single JSON object.

Parameters:
map - the JSON object to marshal
Returns:
the JSON formatted text

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim