Class UonSerializer.Builder<SELF extends UonSerializer.Builder<SELF>>
- Direct Known Subclasses:
OpenApiSerializer.Builder,UonSerializer.DefaultBuilder,UrlEncodingSerializer.Builder
- Enclosing class:
- UonSerializer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor, default settings.protectedBuilder(UonSerializer copyFrom) Copy constructor.protectedBuilder(UonSerializer.Builder<?> copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionAdd"_type" properties when needed.addBeanTypesUon(boolean value) Same asaddBeanTypesUon()but allows you to explicitly specify the value.build()Build the object.abstract SELFcopy()Copy creator.encoding()Encode non-valid URI characters.encoding(boolean value) Same asencoding()but allows you to disable the previous setting.hashKey()Returns the hashkey of this builder.paramFormat(ParamFormat value) Format to use for query/form-data/header values.Format to use for query/form-data/header values.quoteCharUon(char value) Specifies the quote character.Methods inherited from class org.apache.juneau.marshall.serializer.WriterSerializer.Builder
maxIndent, quoteChar, quoteCharOverride, sq, streamCharset, useWhitespace, useWhitespace, wsMethods inherited from class org.apache.juneau.marshall.serializer.Serializer.Builder
accept, addBeanTypes, addBeanTypes, addRootType, addRootType, getAccept, getProduces, keepNullProperties, keepNullProperties, listener, nonDefault, nonDefault, produces, sortCollections, sortCollections, sortMaps, sortMaps, trimEmptyCollections, trimEmptyCollections, trimEmptyMaps, trimEmptyMaps, trimStrings, trimStrings, uriContext, uriRelativity, uriResolutionMethods inherited from class org.apache.juneau.marshall.MarshallingTraverseContext.Builder
detectRecursions, detectRecursions, ignoreRecursions, ignoreRecursions, initialDepth, maxDepthMethods inherited from class org.apache.juneau.marshall.MarshallingContextable.Builder
activeView, annotations, beanClassVisibility, beanConstructorVisibility, beanDictionary, beanFieldVisibility, beanInterceptor, beanMapPutReturnsOldValue, beanMethodVisibility, beanProperties, beanProperties, beanProperties, beanPropertiesExcludes, beanPropertiesExcludes, beanPropertiesExcludes, beanPropertiesReadOnly, beanPropertiesReadOnly, beanPropertiesReadOnly, beanPropertiesWriteOnly, beanPropertiesWriteOnly, beanPropertiesWriteOnly, beansRequireDefaultConstructor, beansRequireSerializable, beansRequireSettersForGetters, bigNumberFormat, binaryFormat, bitSetFormat, booleanFormat, calendarFormat, classFormat, classLoader, currencyFormat, dateFormat, debug, dictionaryOn, disableBeansRequireSomeProperties, disableDefaultViewInclusion, disableIgnoreMissingSetters, disableIgnoreTransientFields, disableIgnoreUnknownNullBeanProperties, disableInterfaceProxies, durationFormat, enumFormat, example, example, findFluentSetters, findFluentSetters, floatFormat, ignoreInvocationExceptionsOnGetters, ignoreInvocationExceptionsOnSetters, ignoreUnknownBeanProperties, ignoreUnknownEnumValues, implClass, implClasses, interfaceClass, interfaces, locale, localeFormat, marshallingContext, marshallingContext, marshallingContext, marshallingContext, mediaType, notBeanClasses, notBeanPackages, periodFormat, propertyNamer, propertyNamer, recordComponentOrder, stopClass, swap, swap, swaps, swaps, temporalFormat, timeZone, timeZoneFormat, typeName, typePropertyName, typePropertyName, unsortedProperties, unsortedProperties, useJavaBeanIntrospector, uuidFormat, validateSchema, validateSchemaMethods inherited from class org.apache.juneau.marshall.Context.Builder
annotations, apply, applyAnnotations, applyAnnotations, asSubtype, build, cache, canApply, copyOrNull, debug, getApplied, getType, impl, isDebug, registerBuilders, self, type
-
Constructor Details
-
Builder
protected Builder()Constructor, default settings. -
Builder
Copy constructor.- Parameters:
copyFrom- The builder to copy from.
Cannot benull .
-
Builder
Copy constructor.- Parameters:
copyFrom- The bean to copy from.
Cannot benull .
-
-
Method Details
-
addBeanTypesUon
Add"_type" properties when needed.If
true , then"_type" properties will be added to beans if their type cannot be inferred through reflection.When present, this value overrides the
Serializer.Builder#addBeanTypes()setting and is provided to customize the behavior of specific serializers in aSerializerSet.- Returns:
- This object.
-
addBeanTypesUon
Same asaddBeanTypesUon()but allows you to explicitly specify the value.- Parameters:
value- The value for this setting.- Returns:
- This object.
-
build
Description copied from class:Context.BuilderBuild the object.- Overrides:
buildin classWriterSerializer.Builder<SELF extends UonSerializer.Builder<SELF>>- Returns:
- The built object.
-
copy
Description copied from class:Context.BuilderCopy creator.- Specified by:
copyin classWriterSerializer.Builder<SELF extends UonSerializer.Builder<SELF>>- Returns:
- A new mutable copy of this builder.
-
encoding
Encode non-valid URI characters.Encode non-valid URI characters with
"%xx" constructs.If
true , non-valid URI characters will be converted to"%xx" sequences.
Set tofalse if parameter value is being passed to some other code that will already perform URL-encoding of non-valid URI characters.Example:
// Create a non-encoding UON serializer. UonSerializerserializer1 = UonSerializer. .create () .build();// Create an encoding UON serializer. UonSerializerserializer2 = UonSerializer. .create () .encoding() .build(); JsonMapmap = JsonMap.of ("foo" ,"foo bar" );// Produces: "(foo=foo bar)" Stringuon1 =serializer1 .write(map )// Produces: "(foo=foo%20bar)" Stringuon2 =serializer2 .write(map )- Returns:
- This object.
-
encoding
Same asencoding()but allows you to disable the previous setting.- Parameters:
value- The new value for this setting.- Returns:
- This object.
-
hashKey
Description copied from class:Context.BuilderReturns the hashkey of this builder.Used to return previously instantiated context beans that have matching hashkeys. The
HashKeyobject is suitable for use as a hashmap key of a map of context beans. A context bean is considered equivalent if theHashKey.equals(Object)method is the same.- Overrides:
hashKeyin classWriterSerializer.Builder<SELF extends UonSerializer.Builder<SELF>>- Returns:
- The hashkey of this builder.
-
paramFormat
Format to use for query/form-data/header values.Specifies the format to use for URL GET parameter keys and values.
Example:
// Create a normal UON serializer. UonSerializerserializer1 = UonSerializer .create () .build();// Create a plain-text UON serializer. UonSerializerserializer2 = UonSerializer .create () .paramFormat(PLAIN_TEXT ) .build(); JsonMapmap = JsonMap.of ("foo" ,"bar" ,"baz" ,new String[]{"qux" ,"true" ,"123" } );// Produces: "(foo=bar,baz=@(qux,'true','123'))" Stringuon1 =serializer1 .write(map )// Produces: "foo=bar,baz=qux,true,123" Stringuon2 =serializer2 .write(map )ParamFormat.UON(default) - Use UON notation for parameters.ParamFormat.PLAINTEXT- Use plain text for parameters.
- Parameters:
value- The new value for this property.
The default value isParamFormat.UON.
Cannot benull .- Returns:
- This object.
-
paramFormatPlain
Format to use for query/form-data/header values.Specifies plain-text for the format to use for URL GET parameter keys and values.
Example:
// Create a plain-text UON serializer. UonSerializerserializer = UonSerializer .create () .paramFormatPlain() .build(); JsonMapmap = JsonMap.of ("foo" ,"bar" ,"baz" ,new String[]{"qux" ,"true" ,"123" } );// Produces: "foo=bar,baz=qux,true,123" Stringuon =serializer .write(map )- Returns:
- This object.
-
quoteCharUon
Specifies the quote character.- Parameters:
value- The value for this setting.- Returns:
- This object.
-