Package org.glassfish.jersey.jettison
Class JettisonConfig
java.lang.Object
org.glassfish.jersey.jettison.JettisonConfig
An immutable configuration of JSON notation and options.
JettisonConfig
instance can be used for configuring the JSON notation on JettisonJaxbContext
.- Author:
- Jakub Podlesak
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class for constructingJettisonConfig
optionsstatic class
Builder class for constructingJettisonConfig
options for theJettisonConfig.Notation.MAPPED_JETTISON
convention.static enum
Enumeration of supported JSON notations. -
Field Summary
Modifier and TypeFieldDescriptionstatic final JettisonConfig
The defaultJettisonConfig
usesJettisonConfig.Notation.MAPPED_JETTISON
notation with root unwrapping option set to true. -
Method Summary
Modifier and TypeMethodDescriptionstatic JettisonConfig.Builder
A static method for obtaining a builder ofJettisonConfig
instance, which will useJettisonConfig.Notation.BADGERFISH
JSON notation.static JettisonConfig.Builder
static JettisonConfig
A static method for obtainingJettisonConfig
instance with humanReadableFormatting set according to formatted parameter.Returns a list of elements to be treated as arrays.Returns JSON notation selected for this configurationReturns a map for XML to JSON namespace mapping This property is valid for theJettisonConfig.Notation.MAPPED_JETTISON
notation only.A static method for obtaining a builder ofJettisonConfig
instance, which will useJettisonConfig.Notation.MAPPED_JETTISON
JSON notation.toString()
-
Field Details
-
DEFAULT
The defaultJettisonConfig
usesJettisonConfig.Notation.MAPPED_JETTISON
notation with root unwrapping option set to true.
-
-
Method Details
-
createJSONConfiguration
public static JettisonConfig createJSONConfiguration(JettisonConfig c) throws IllegalArgumentException A static method for obtainingJettisonConfig
instance with humanReadableFormatting set according to formatted parameter.- Parameters:
c
- original instance ofJettisonConfig
, can't be null- Returns:
- copy of provided
JettisonConfig
with humanReadableFormatting set to formatted. - Throws:
IllegalArgumentException
- when providedJettisonConfig
is null.
-
mappedJettison
A static method for obtaining a builder ofJettisonConfig
instance, which will useJettisonConfig.Notation.MAPPED_JETTISON
JSON notation. After getting the builder, you can set configuration options on it and finally get an immutableJettisonConfig
instance using theJettisonConfig.Builder.build()
method.- Returns:
- a builder for
JettisonConfig
instance
-
badgerFish
A static method for obtaining a builder ofJettisonConfig
instance, which will useJettisonConfig.Notation.BADGERFISH
JSON notation. After getting the builder, you can set configuration options on it and finally get an immutableJettisonConfig
instance using theJettisonConfig.Builder.build()
method.- Returns:
- a builder for
JettisonConfig
instance
-
copyBuilder
-
getNotation
Returns JSON notation selected for this configuration- Returns:
- JSON notation
-
getXml2JsonNs
Returns a map for XML to JSON namespace mapping This property is valid for theJettisonConfig.Notation.MAPPED_JETTISON
notation only.- Returns:
- a map for XML to JSON namespace mapping.
- See Also:
-
getArrayElements
Returns a list of elements to be treated as arrays. I.e. these elements will be serialized as arrays even if only a single element is included. This property is valid for theJettisonConfig.Notation.MAPPED_JETTISON
notation only.- Returns:
- a list of elements representing arrays.
- See Also:
-
toString
-