public class JodaBeanSimpleMapWriter
extends java.lang.Object
Map.
This class contains mutable state and cannot be used from multiple threads. A new instance must be created for each message.
The format used here is natural, with no meta-data. As such, it may not be possible to write some objects or read the JSON data back in.
Beans are output as maps where the key is the property name.
Most simple types, defined by Joda-Convert, are output as JSON strings.
Null values are generally omitted, booleans and numbers are left as is.
Maps must have a key that can be converted to a string by Joda-Convert.
The property type needs to be known when writing/reading - properties, or
list/map entries, that are defined as Object are unlikely to work well.
Collections are output using lists, Maps as maps, with other collection types having a complex list-based format.
| Constructor | Description |
|---|---|
JodaBeanSimpleMapWriter(JodaBeanSer settings) |
Creates an instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
write(Bean bean) |
Writes the bean to a string.
|
public JodaBeanSimpleMapWriter(JodaBeanSer settings)
settings - the settings to use, not nullpublic java.util.Map<java.lang.String,java.lang.Object> write(Bean bean)
bean - the bean to output, not nullCopyright © 2007–2018 Joda.org. All rights reserved.