Class MarshallingSession.Builder<SELF extends MarshallingSession.Builder<SELF>>
- Direct Known Subclasses:
MarshallingSession.DefaultBuilder,MarshallingTraverseSession.Builder,ParserSession.Builder
- Enclosing class:
- MarshallingSession
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactiveView(String value) Overrides the active view for this session.build()Build the object.The session locale.The session media type.mediaTypeDefault(MediaType value) Same asmediaType(MediaType)but doesn't overwrite the value if it is already set.Adds a property to this session.The session timezone.timeZoneDefault(TimeZone value) Same astimeZone(TimeZone)but doesn't overwrite the value if it is already set.Methods inherited from class org.apache.juneau.marshall.ContextSession.Builder
apply, cvt, debug, properties, self, unmodifiable
-
Constructor Details
-
Builder
Constructor- Parameters:
ctx- The context creating this session.
Cannot benull .
-
-
Method Details
-
build
Build the object.- Specified by:
buildin classContextSession.Builder<SELF extends MarshallingSession.Builder<SELF>>- Returns:
- The built object.
-
locale
The session locale.Specifies the default locale for serializer and parser sessions.
If not specified, defaults to
MarshallingContext.Builder.locale(Locale).See Also:
- Parameters:
value- The new value for this property.
Ifnull defaults toMarshallingContext.getLocale()- Returns:
- This object.
-
mediaType
The session media type.Specifies the default media type value for serializer and parser sessions.
If not specified, defaults to
MarshallingContext.Builder.mediaType(MediaType).See Also:
- Parameters:
value- The new value for this property.
Ifnull defaults toMarshallingContext.getMediaType().- Returns:
- This object.
-
mediaTypeDefault
Same asmediaType(MediaType)but doesn't overwrite the value if it is already set.- Parameters:
value- The new value for this property.
Ifnull , then the media type defined on the context is used.- Returns:
- This object.
-
activeView
Overrides the active view for this session.When set, only bean properties whose declared
MarshalledProp.view()set contains this view name will be included during serialization. On the parse side, out-of-view properties are routed through the existing unknown/ignored-property mechanism.This is a per-call override. If not set, the value from
MarshallingContext.Builder.activeView(String)is used.See Also:
- Parameters:
value- The active view name. Usenull to disable view filtering for this call.- Returns:
- This object.
- Since:
- 10.0.0
-
property
Description copied from class:ContextSession.BuilderAdds a property to this session.If the key matches a known session property (e.g.
"debug" or"ContextSession.debug" ), the value is converted viaBasicConverterand routed to the corresponding typed setter. Unknown keys are stored in the raw session properties map.- Overrides:
propertyin classContextSession.Builder<SELF extends MarshallingSession.Builder<SELF>>- Parameters:
key- The property key.
Cannot benull .value- The property value.
Can benull (resets typed properties to their default; removes raw properties).- Returns:
- This object.
-
timeZone
The session timezone.Specifies the default timezone for serializer and parser sessions.
If not specified, defaults to
MarshallingContext.Builder.timeZone(TimeZone).See Also:
- Parameters:
value- The new value for this property.
Ifnull defaults toMarshallingContext.getTimeZone().- Returns:
- This object.
-
timeZoneDefault
Same astimeZone(TimeZone)but doesn't overwrite the value if it is already set.- Parameters:
value- The new value for this property.
Ifnull , then the time zone defined on the context is used.- Returns:
- This object.
-