Class SerializerSession.Builder<SELF extends SerializerSession.Builder<SELF>>
java.lang.Object
org.apache.juneau.marshall.ContextSession.Builder<SELF>
org.apache.juneau.marshall.MarshallingSession.Builder<SELF>
org.apache.juneau.marshall.MarshallingTraverseSession.Builder<SELF>
org.apache.juneau.marshall.serializer.SerializerSession.Builder<SELF>
- Direct Known Subclasses:
OutputStreamSerializerSession.Builder,SerializerSession.DefaultBuilder,WriterSerializerSession.Builder
- Enclosing class:
- SerializerSession
public abstract static class SerializerSession.Builder<SELF extends SerializerSession.Builder<SELF>>
extends MarshallingTraverseSession.Builder<SELF>
Builder class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBeanTypes(boolean value) Add bean types.addRootType(boolean value) Add root type.build()Build the object.javaMethod(Method value) The java method that called this serializer, usually the method in a REST servlet.keepNullProperties(boolean value) Keep null bean property values.nonDefault(boolean value) Non-default inclusion.Adds a property to this session.resolver(VarResolverSession value) String variable resolver.schema(HttpPartSchema value) HTTP-part schema.schemaDefault(HttpPartSchema value) Same asschema(HttpPartSchema)but doesn't overwrite the value if it is already set.sortCollections(boolean value) Sort collections.sortMaps(boolean value) Sort maps.trimEmptyCollections(boolean value) Trim empty collections.trimEmptyMaps(boolean value) Trim empty maps.trimStrings(boolean value) Trim strings.uriContext(UriContext value) URI context bean.Methods inherited from class org.apache.juneau.marshall.MarshallingTraverseSession.Builder
initialDepthMethods inherited from class org.apache.juneau.marshall.MarshallingSession.Builder
activeView, locale, mediaType, mediaTypeDefault, timeZone, timeZoneDefaultMethods 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
Description copied from class:MarshallingSession.BuilderBuild the object.- Overrides:
buildin classMarshallingSession.Builder<SELF extends SerializerSession.Builder<SELF>>- Returns:
- The built object.
-
javaMethod
The java method that called this serializer, usually the method in a REST servlet.- Parameters:
value- The new property value.
Can benull (value will not be set, existing value will be kept).- Returns:
- This object.
-
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 classMarshallingTraverseSession.Builder<SELF extends SerializerSession.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.
-
resolver
String variable resolver.If not specified, defaults to session created by
VarResolver.DEFAULT.- Parameters:
value- The new property value.
Can benull (value will not be set, defaults to session created byVarResolver.DEFAULTwhen accessed).- Returns:
- This object.
-
schema
HTTP-part schema.Used for schema-based serializers and parsers to define additional formatting.
- Parameters:
value- The new value for this property.
Can benull (value will not be set, existing value will be kept).- Returns:
- This object.
-
schemaDefault
Same asschema(HttpPartSchema)but doesn't overwrite the value if it is already set.- Parameters:
value- The new value for this property.
Can benull (value will not be set).- Returns:
- This object.
-
uriContext
URI context bean.Bean used for resolution of URIs to absolute or root-relative form.
If not specified, defaults to
Serializer.Builder.uriContext(UriContext).- Parameters:
value- The new property value.
Can benull (value will not be set, defaults toSerializer.Builder.uriContext(UriContext)from context).- Returns:
- This object.
-
keepNullProperties
Keep null bean property values.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
nonDefault
Non-default inclusion.- Parameters:
value- The new value for this property.- Returns:
- This object.
- Since:
- 10.0.0
-
trimStrings
Trim strings.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
addBeanTypes
Add bean types.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
addRootType
Add root type.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
sortCollections
Sort collections.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
sortMaps
Sort maps.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
trimEmptyCollections
Trim empty collections.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
trimEmptyMaps
Trim empty maps.- Parameters:
value- The new value for this property.- Returns:
- This object.
-