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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for constructingJettisonConfigoptionsstatic classBuilder class for constructingJettisonConfigoptions for theJettisonConfig.Notation.MAPPED_JETTISONconvention.static enumEnumeration of supported JSON notations. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JettisonConfigThe defaultJettisonConfigusesJettisonConfig.Notation.MAPPED_JETTISONnotation with root unwrapping option set to true. -
Method Summary
Modifier and TypeMethodDescriptionstatic JettisonConfig.BuilderA static method for obtaining a builder ofJettisonConfiginstance, which will useJettisonConfig.Notation.BADGERFISHJSON notation.static JettisonConfig.Builderstatic JettisonConfigA static method for obtainingJettisonConfiginstance 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_JETTISONnotation only.A static method for obtaining a builder ofJettisonConfiginstance, which will useJettisonConfig.Notation.MAPPED_JETTISONJSON notation.toString()
-
Field Details
-
DEFAULT
The defaultJettisonConfigusesJettisonConfig.Notation.MAPPED_JETTISONnotation with root unwrapping option set to true.
-
-
Method Details
-
createJSONConfiguration
public static JettisonConfig createJSONConfiguration(JettisonConfig c) throws IllegalArgumentException A static method for obtainingJettisonConfiginstance with humanReadableFormatting set according to formatted parameter.- Parameters:
c- original instance ofJettisonConfig, can't be null- Returns:
- copy of provided
JettisonConfigwith humanReadableFormatting set to formatted. - Throws:
IllegalArgumentException- when providedJettisonConfigis null.
-
mappedJettison
A static method for obtaining a builder ofJettisonConfiginstance, which will useJettisonConfig.Notation.MAPPED_JETTISONJSON notation. After getting the builder, you can set configuration options on it and finally get an immutableJettisonConfiginstance using theJettisonConfig.Builder.build()method.- Returns:
- a builder for
JettisonConfiginstance
-
badgerFish
A static method for obtaining a builder ofJettisonConfiginstance, which will useJettisonConfig.Notation.BADGERFISHJSON notation. After getting the builder, you can set configuration options on it and finally get an immutableJettisonConfiginstance using theJettisonConfig.Builder.build()method.- Returns:
- a builder for
JettisonConfiginstance
-
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_JETTISONnotation 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_JETTISONnotation only.- Returns:
- a list of elements representing arrays.
- See Also:
-
toString
-