Class UrlEncodingSerializer.Builder
- Enclosing class:
- UrlEncodingSerializer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor, default settings.protectedBuilder(UrlEncodingSerializer copyFrom) Copy constructor.protectedBuilder(UrlEncodingSerializer.Builder copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the object.copy()Copy creator.Serialize bean property collections/arrays as separate key/value pairs.expandedParams(boolean value) Same asexpandedParams()but allows you to explicitly specify the value.hashKey()Returns the hashkey of this builder.Methods inherited from class org.apache.juneau.marshall.uon.UonSerializer.Builder
addBeanTypesUon, addBeanTypesUon, encoding, encoding, paramFormat, paramFormatPlain, quoteCharUonMethods 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
-
build
Description copied from class:Context.BuilderBuild the object.- Overrides:
buildin classUonSerializer.Builder<UrlEncodingSerializer.Builder>- Returns:
- The built object.
-
copy
Description copied from class:Context.BuilderCopy creator.- Specified by:
copyin classUonSerializer.Builder<UrlEncodingSerializer.Builder>- Returns:
- A new mutable copy of this builder.
-
expandedParams
Serialize bean property collections/arrays as separate key/value pairs.By default, serializing the array
[1,2,3] results in?key=$a(1,2,3) .
When enabled, serializing the same array results in?key=1&key=2&key=3 .This option only applies to beans.
Notes:
-
If parsing multi-part parameters, it's highly recommended to use
Collections orLists as bean property types instead of arrays since arrays have to be recreated from scratch every time a value is added to it.
Example:
// A sample bean. public class A {public String[]f1 = {"a" ,"b" };public List<String>f2 = Arrays.asList (new String[]{"c" ,"d" }); }// Normal serializer. WriterSerializerserializer1 = UrlEncodingSerializer.DEFAULT ;// Expanded-params serializer. WriterSerializerserializer2 = UrlEncodingSerializer.create ().expandedParams().build();// Produces "f1=(a,b)&f2=(c,d)" Stringout1 =serializer1 .write(new A());// Produces "f1=a&f1=b&f2=c&f2=d" Stringout2 =serializer2 .write(new A());- Returns:
- This object.
-
If parsing multi-part parameters, it's highly recommended to use
-
expandedParams
Same asexpandedParams()but allows you to explicitly specify the value.- Parameters:
value- The 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 classUonSerializer.Builder<UrlEncodingSerializer.Builder>- Returns:
- The hashkey of this builder.
-