public static class JSONConfiguration.MappedBuilder extends JSONConfiguration.Builder
JSONConfiguration
options
for the JSONConfiguration.Notation.MAPPED
convention.arrays, attrsAsElems, humanReadableFormatting, jsonXml2JsonNs, namespaceSeparator, nonStrings, rootUnwrapping, usePrefixAtNaturalAttributes
Modifier and Type | Method and Description |
---|---|
JSONConfiguration.MappedBuilder |
arrays(java.lang.String... arrays)
Adds name(s) to JSON arrays configuration property.
|
JSONConfiguration.MappedBuilder |
attributeAsElement(java.lang.String... attributeAsElements)
Adds name(s) toJSON attributes as elements property.
|
JSONConfiguration.MappedBuilder |
nonStrings(java.lang.String... nonStrings)
Adds name(s) JSON non-string values property.
|
JSONConfiguration.MappedBuilder |
nsSeparator(java.lang.Character separator)
Setter for XML namespace separator.
|
JSONConfiguration.MappedBuilder |
rootUnwrapping(boolean rootUnwrapping)
Setter for XML root element unwrapping.
|
JSONConfiguration.MappedBuilder |
xml2JsonNs(java.util.Map<java.lang.String,java.lang.String> jsonXml2JsonNs)
Setter for XML to JSON namespace mapping.
|
build
public JSONConfiguration.MappedBuilder arrays(java.lang.String... arrays)
JSONConfiguration.Notation.MAPPED
notation only.
The property value is a collection of strings representing JSON object names. Those objects will be declared as arrays in JSON document.
For example, consider that the property value is not set and the
JSON document is { ..., "arr1":"single element", ... }
.
If the property value is set to contain "arr1"
then
the JSON document would become { ..., "arr1":["single element"], ... }
.
The default value is an empty collection.
arrays
- an array of strings representing JSON object names.public JSONConfiguration.MappedBuilder attributeAsElement(java.lang.String... attributeAsElements)
JSONConfiguration.Notation.MAPPED
notation only.
The value is a collection of string values that are object names that correspond to XML attribute information items. The value of an object name in the JSON document that exists in the collection of object names will be declared as an element as not as an attribute if the object corresponds to an XML attribute information item.
For example, consider that the property value is not set and the
JSON document is { ..., "@number":"12", ... }
.
If the property value is set to contain "number"
then the JSON document would be { ..., "number":"12", ... }
.
The default value is an empty collection.
attributeAsElements
- an array of string values that are
object names that correspond to XML attribute information items.public JSONConfiguration.MappedBuilder nonStrings(java.lang.String... nonStrings)
JSONConfiguration.Notation.MAPPED
notation only.
The value is collection of string values that are object names. The value of an object name in the JSON document that exists in the collection of object names will be declared as non-string value, which is not surrounded by double quotes.
For example, consider that the property value is not set and the
JSON document is { ..., "anumber":"12", ... }
.
If the property value is set to contain "anumber"
then the JSON document would be { ..., "anumber":12, ... }
.
The default value is an empty collection.
nonStrings
- an array of string values that are
object namespublic JSONConfiguration.MappedBuilder xml2JsonNs(java.util.Map<java.lang.String,java.lang.String> jsonXml2JsonNs)
JSONConfiguration.Notation.MAPPED_JETTISON
and JSONConfiguration.Notation.MAPPED
notations only.
The value is a map with zero or more key/value pairs, where the key is an XML namespace and the value is the prefix to use as the replacement for the XML namespace.
The default value is a map with zero key/value pairs.
public JSONConfiguration.MappedBuilder nsSeparator(java.lang.Character separator)
JSONConfiguration.Notation.MAPPED
notation only.
The value is a character used to separate a namespace identifier from the name of a XML attribute/element in JSON.
The default value is dot character ('.').
public JSONConfiguration.MappedBuilder rootUnwrapping(boolean rootUnwrapping)
JSONConfiguration.Notation.MAPPED
and JSONConfiguration.Notation.NATURAL
notations only.
If set to true, JSON code corresponding to the XML root element will be stripped out
The default value is false.
rootUnwrapping
- if set to true, JSON code corresponding to the
XML root element will be stripped out.Copyright © 2016 Oracle Corporation. All Rights Reserved.