public class SerializerGroupBuilder extends BeanTraverseBuilder
SerializerGroup
.psb
Constructor and Description |
---|
SerializerGroupBuilder()
Create an empty serializer group builder.
|
SerializerGroupBuilder(SerializerGroup copyFrom)
Clone an existing serializer group builder.
|
Modifier and Type | Method and Description |
---|---|
SerializerGroupBuilder |
add(Map<String,Object> properties)
Adds multiple configuration properties on this object.
|
SerializerGroupBuilder |
addBeanTypes()
Configuration property: Add
|
SerializerGroupBuilder |
addBeanTypes(boolean value)
Configuration property: Add
|
SerializerGroupBuilder |
addRootType()
Configuration property: Add type attribute to root nodes.
|
SerializerGroupBuilder |
addRootType(boolean value)
Configuration property: Add type attribute to root nodes.
|
SerializerGroupBuilder |
addTo(String name,
Object value)
Adds a value to a SET or LIST property.
|
SerializerGroupBuilder |
addTo(String name,
String key,
Object value)
Adds or overwrites a value to a SET, LIST, or MAP property.
|
SerializerGroupBuilder |
append(Class<?>... s)
Registers the specified serializers with this group.
|
SerializerGroupBuilder |
append(List<Object> s)
Registers the specified serializers with this group.
|
SerializerGroupBuilder |
append(Object... s)
Registers the specified serializers with this group.
|
SerializerGroupBuilder |
append(Serializer... s)
Registers the specified serializers with this group.
|
SerializerGroupBuilder |
apply(PropertyStore copyFrom)
Copies the settings from the specified property store into this builder.
|
SerializerGroupBuilder |
applyAnnotations(AnnotationList al,
VarResolverSession vrs)
Applies a set of annotations to this property store.
|
SerializerGroupBuilder |
applyAnnotations(Class<?> fromClass)
Applies any of the various
|
SerializerGroupBuilder |
applyAnnotations(Method fromMethod)
Applies any of the various
|
SerializerGroupBuilder |
beanClassVisibility(Visibility value)
Configuration property: Minimum bean class visibility.
|
SerializerGroupBuilder |
beanConstructorVisibility(Visibility value)
Configuration property: Minimum bean constructor visibility.
|
SerializerGroupBuilder |
beanDictionary(Class<?>... values)
Configuration property: Bean dictionary.
|
SerializerGroupBuilder |
beanDictionary(Object... values)
Configuration property: Bean dictionary.
|
SerializerGroupBuilder |
beanDictionaryRemove(Class<?>... values)
Configuration property: Bean dictionary.
|
SerializerGroupBuilder |
beanDictionaryRemove(Object... values)
Configuration property: Bean dictionary.
|
SerializerGroupBuilder |
beanDictionaryReplace(Class<?>... values)
Configuration property: Bean dictionary.
|
SerializerGroupBuilder |
beanDictionaryReplace(Object... values)
Configuration property: Bean dictionary.
|
SerializerGroupBuilder |
beanFieldVisibility(Visibility value)
Configuration property: Minimum bean field visibility.
|
SerializerGroupBuilder |
beanFilters(Class<?>... values)
Configuration property: Bean filters.
|
SerializerGroupBuilder |
beanFilters(Object... values)
Configuration property: Bean filters.
|
SerializerGroupBuilder |
beanFiltersRemove(Class<?>... values)
Configuration property: Bean filters.
|
SerializerGroupBuilder |
beanFiltersRemove(Object... values)
Configuration property: Bean filters.
|
SerializerGroupBuilder |
beanFiltersReplace(Class<?>... values)
Configuration property: Bean filters.
|
SerializerGroupBuilder |
beanFiltersReplace(Object... values)
Configuration property: Bean filters.
|
SerializerGroupBuilder |
beanMapPutReturnsOldValue()
Configuration property: BeanMap.put() returns old property value.
|
SerializerGroupBuilder |
beanMapPutReturnsOldValue(boolean value)
Configuration property: BeanMap.put() returns old property value.
|
SerializerGroupBuilder |
beanMethodVisibility(Visibility value)
Configuration property: Minimum bean method visibility.
|
SerializerGroupBuilder |
beansRequireDefaultConstructor()
Configuration property: Beans require no-arg constructors.
|
SerializerGroupBuilder |
beansRequireDefaultConstructor(boolean value)
Configuration property: Beans require no-arg constructors.
|
SerializerGroupBuilder |
beansRequireSerializable()
Configuration property: Beans require Serializable interface.
|
SerializerGroupBuilder |
beansRequireSerializable(boolean value)
Configuration property: Beans require Serializable interface.
|
SerializerGroupBuilder |
beansRequireSettersForGetters()
Configuration property: Beans require setters for getters.
|
SerializerGroupBuilder |
beansRequireSettersForGetters(boolean value)
Configuration property: Beans require setters for getters.
|
SerializerGroupBuilder |
beansRequireSomeProperties(boolean value)
Configuration property: Beans require at least one property.
|
SerializerGroupBuilder |
beanTypePropertyName(String value)
Configuration property: Bean type property name.
|
SerializerGroupBuilder |
binaryOutputFormat(BinaryFormat value)
Configuration property: Binary string format.
|
SerializerGroup |
build()
Creates a new
SerializerGroup object using a snapshot of the settings defined in this builder. |
SerializerGroupBuilder |
debug()
Configuration property: Debug mode.
|
SerializerGroupBuilder |
detectRecursions()
Configuration property: Automatically detect POJO recursions.
|
SerializerGroupBuilder |
detectRecursions(boolean value)
Configuration property: Automatically detect POJO recursions.
|
<T> SerializerGroupBuilder |
example(Class<T> c,
T o)
Configuration property: POJO example.
|
<T> SerializerGroupBuilder |
exampleJson(Class<T> c,
String value)
Configuration property: POJO example.
|
SerializerGroupBuilder |
fileCharset(Charset value)
Configuration property: File charset.
|
SerializerGroupBuilder |
ignoreInvocationExceptionsOnGetters()
Configuration property: Ignore invocation errors on getters.
|
SerializerGroupBuilder |
ignoreInvocationExceptionsOnGetters(boolean value)
Configuration property: Ignore invocation errors on getters.
|
SerializerGroupBuilder |
ignoreInvocationExceptionsOnSetters()
Configuration property: Ignore invocation errors on setters.
|
SerializerGroupBuilder |
ignoreInvocationExceptionsOnSetters(boolean value)
Configuration property: Ignore invocation errors on setters.
|
SerializerGroupBuilder |
ignorePropertiesWithoutSetters(boolean value)
Configuration property: Ignore properties without setters.
|
SerializerGroupBuilder |
ignoreRecursions()
Configuration property: Ignore recursion errors.
|
SerializerGroupBuilder |
ignoreRecursions(boolean value)
Configuration property: Ignore recursion errors.
|
SerializerGroupBuilder |
ignoreUnknownBeanProperties()
Configuration property: Ignore unknown properties.
|
SerializerGroupBuilder |
ignoreUnknownBeanProperties(boolean value)
Configuration property: Ignore unknown properties.
|
SerializerGroupBuilder |
ignoreUnknownNullBeanProperties(boolean value)
Configuration property: Ignore unknown properties with null values.
|
SerializerGroupBuilder |
implClass(Class<?> interfaceClass,
Class<?> implClass)
Configuration property: Implementation classes.
|
SerializerGroupBuilder |
implClasses(Map<String,Class<?>> values)
Configuration property: Implementation classes.
|
SerializerGroupBuilder |
initialDepth(int value)
Configuration property: Initial depth.
|
SerializerGroupBuilder |
listener(Class<? extends SerializerListener> value)
Configuration property: Serializer listener.
|
SerializerGroupBuilder |
locale(Locale value)
Configuration property: Locale.
|
SerializerGroupBuilder |
maxDepth(int value)
Configuration property: Max traversal depth.
|
SerializerGroupBuilder |
maxIndent(int value)
Configuration property: Maximum indentation.
|
SerializerGroupBuilder |
mediaType(MediaType value)
Configuration property: Media type.
|
SerializerGroupBuilder |
notBeanClasses(Class<?>... values)
Configuration property: Bean class exclusions.
|
SerializerGroupBuilder |
notBeanClasses(Object... values)
Configuration property: Bean class exclusions.
|
SerializerGroupBuilder |
notBeanClassesRemove(Class<?>... values)
Configuration property: Bean class exclusions.
|
SerializerGroupBuilder |
notBeanClassesRemove(Object... values)
Configuration property: Bean class exclusions.
|
SerializerGroupBuilder |
notBeanClassesReplace(Class<?>... values)
Configuration property: Bean class exclusions.
|
SerializerGroupBuilder |
notBeanClassesReplace(Object... values)
Configuration property: Bean class exclusions.
|
SerializerGroupBuilder |
notBeanPackages(Object... values)
Configuration property: Bean package exclusions.
|
SerializerGroupBuilder |
notBeanPackages(String... values)
Configuration property: Bean package exclusions.
|
SerializerGroupBuilder |
notBeanPackagesRemove(Object... values)
Configuration property: Bean package exclusions.
|
SerializerGroupBuilder |
notBeanPackagesRemove(String... values)
Configuration property: Bean package exclusions.
|
SerializerGroupBuilder |
notBeanPackagesReplace(Object... values)
Configuration property: Bean package exclusions.
|
SerializerGroupBuilder |
notBeanPackagesReplace(String... values)
Configuration property: Bean package exclusions.
|
SerializerGroupBuilder |
pojoSwaps(Class<?>... values)
Configuration property: POJO swaps.
|
SerializerGroupBuilder |
pojoSwaps(Object... values)
Configuration property: POJO swaps.
|
SerializerGroupBuilder |
pojoSwapsRemove(Class<?>... values)
Configuration property: POJO swaps.
|
SerializerGroupBuilder |
pojoSwapsRemove(Object... values)
Configuration property: POJO swaps.
|
SerializerGroupBuilder |
pojoSwapsReplace(Class<?>... values)
Configuration property: POJO swaps.
|
SerializerGroupBuilder |
pojoSwapsReplace(Object... values)
Configuration property: POJO swaps.
|
SerializerGroupBuilder |
quoteChar(char value)
Configuration property: Quote character.
|
SerializerGroupBuilder |
removeFrom(String name,
Object value)
Removes a value from a SET, LIST, or MAP property.
|
SerializerGroupBuilder |
set(Map<String,Object> properties)
Sets multiple configuration properties on this object.
|
SerializerGroupBuilder |
set(String name,
Object value)
Sets a configuration property on this object.
|
SerializerGroupBuilder |
sortCollections()
Configuration property: Sort arrays and collections alphabetically.
|
SerializerGroupBuilder |
sortCollections(boolean value)
Configuration property: Sort arrays and collections alphabetically.
|
SerializerGroupBuilder |
sortMaps()
Configuration property: Sort maps alphabetically.
|
SerializerGroupBuilder |
sortMaps(boolean value)
Configuration property: Sort maps alphabetically.
|
SerializerGroupBuilder |
sortProperties()
Configuration property: Sort bean properties.
|
SerializerGroupBuilder |
sortProperties(boolean value)
Configuration property: Sort bean properties.
|
SerializerGroupBuilder |
sq()
Configuration property: Quote character.
|
SerializerGroupBuilder |
streamCharset(Charset value)
Configuration property: Output stream charset.
|
SerializerGroupBuilder |
timeZone(TimeZone value)
Configuration property: TimeZone.
|
SerializerGroupBuilder |
trimEmptyCollections()
Configuration property: Trim empty lists and arrays.
|
SerializerGroupBuilder |
trimEmptyCollections(boolean value)
Configuration property: Trim empty lists and arrays.
|
SerializerGroupBuilder |
trimEmptyMaps()
Configuration property: Trim empty maps.
|
SerializerGroupBuilder |
trimEmptyMaps(boolean value)
Configuration property: Trim empty maps.
|
SerializerGroupBuilder |
trimNullProperties(boolean value)
Configuration property: Trim null bean property values.
|
SerializerGroupBuilder |
trimStrings()
Configuration property: Trim strings.
|
SerializerGroupBuilder |
trimStrings(boolean value)
Configuration property: Trim strings.
|
SerializerGroupBuilder |
uriContext(UriContext value)
Configuration property: URI context bean.
|
SerializerGroupBuilder |
uriRelativity(UriRelativity value)
Configuration property: URI relativity.
|
SerializerGroupBuilder |
uriResolution(UriResolution value)
Configuration property: URI resolution.
|
SerializerGroupBuilder |
useEnumNames()
Configuration property: Use enum names.
|
SerializerGroupBuilder |
useEnumNames(boolean value)
Configuration property: Use enum names.
|
SerializerGroupBuilder |
useInterfaceProxies(boolean value)
Configuration property: Use interface proxies.
|
SerializerGroupBuilder |
useJavaBeanIntrospector()
Configuration property: Use Java Introspector.
|
SerializerGroupBuilder |
useJavaBeanIntrospector(boolean value)
Configuration property: Use Java Introspector.
|
SerializerGroupBuilder |
useWhitespace()
Configuration property: Use whitespace.
|
SerializerGroupBuilder |
useWhitespace(boolean value)
Configuration property: Use whitespace.
|
SerializerGroupBuilder |
ws()
Configuration property: Use whitespace.
|
debug, examples, excludeProperties, excludeProperties, excludeProperties, fluentSetters, fluentSetters, includeProperties, includeProperties, includeProperties, propertyNamer
build, getPropertyStore, getPropertyStoreBuilder, peek, peek
public SerializerGroupBuilder()
public SerializerGroupBuilder(SerializerGroup copyFrom)
copyFrom
- The serializer group that we're copying settings and serializers from.public SerializerGroupBuilder append(Class<?>... s)
s
- The serializers to append to this group.public SerializerGroupBuilder append(Serializer... s)
When passing in pre-instantiated serializers to this group, applying properties and transforms to the group do not affect them.
s
- The serializers to append to this group.public SerializerGroupBuilder append(List<Object> s)
Objects can either be instances of serializers or serializer classes.
s
- The serializers to append to this group.public SerializerGroupBuilder append(Object... s)
Objects can either be instances of serializers or serializer classes.
s
- The serializers to append to this group.public SerializerGroup build()
SerializerGroup
object using a snapshot of the settings defined in this builder.
This method can be called multiple times to produce multiple serializer groups.
build
in class BeanTraverseBuilder
SerializerGroup
object.public SerializerGroupBuilder addBeanTypes(boolean value)
If
value
- The new value for this property.
public SerializerGroupBuilder addBeanTypes()
Shortcut for calling addBeanTypes(
.
public SerializerGroupBuilder addRootType(boolean value)
When disabled, it is assumed that the parser knows the exact Java POJO type being parsed, and therefore top-level type information that might normally be included to determine the data type will not be serialized.
value
- The new value for this property.
public SerializerGroupBuilder addRootType()
Shortcut for calling addRootType(
.
public SerializerGroupBuilder listener(Class<? extends SerializerListener> value)
Class used to listen for errors and warnings that occur during serialization.
value
- The new value for this property.public SerializerGroupBuilder sortCollections(boolean value)
value
- The new value for this property.
public SerializerGroupBuilder sortCollections()
Shortcut for calling sortCollections(
.
public SerializerGroupBuilder sortMaps(boolean value)
value
- The new value for this property.
public SerializerGroupBuilder sortMaps()
Shortcut for calling sortMaps(
.
public SerializerGroupBuilder trimEmptyCollections(boolean value)
If
value
- The new value for this property.
public SerializerGroupBuilder trimEmptyCollections()
Shortcut for calling trimEmptyCollections(
.
public SerializerGroupBuilder trimEmptyMaps(boolean value)
If
value
- The new value for this property.
public SerializerGroupBuilder trimEmptyMaps()
Shortcut for calling trimEmptyMaps(
.
public SerializerGroupBuilder trimNullProperties(boolean value)
If
value
- The new value for this property.
public SerializerGroupBuilder trimStrings(boolean value)
If String.trim()
before being serialized.
value
- The new value for this property.
public SerializerGroupBuilder trimStrings()
Shortcut for calling trimStrings(
.
public SerializerGroupBuilder uriContext(UriContext value)
Bean used for resolution of URIs to absolute or root-relative form.
value
- The new value for this property.public SerializerGroupBuilder uriRelativity(UriRelativity value)
Defines what relative URIs are relative to when serializing URI/URL objects.
value
- The new value for this property.
UriRelativity.RESOURCE
public SerializerGroupBuilder uriResolution(UriResolution value)
Defines the resolution level for URIs when serializing URI/URL objects.
value
- The new value for this property.
UriResolution.NONE
public SerializerGroupBuilder binaryOutputFormat(BinaryFormat value)
When using the Serializer.serializeToString(Object)
method on stream-based serializers, this defines the format to use
when converting the resulting byte array to a string.
value
- The new value for this property.
BinaryFormat.HEX
.public SerializerGroupBuilder fileCharset(Charset value)
The character set to use for writing Files to the file system.
Used when passing in files to Serializer.serialize(Object, Object)
.
value
- The new value for this property.
public SerializerGroupBuilder maxIndent(int value)
Specifies the maximum indentation level in the serialized document.
value
- The new value for this property.
public SerializerGroupBuilder quoteChar(char value)
This is the character used for quoting attributes and values.
value
- The new value for this property.
public SerializerGroupBuilder sq()
Shortcut for calling quoteChar(
.
public SerializerGroupBuilder streamCharset(Charset value)
The character set to use when writing to OutputStreams.
Used when passing in output streams and byte arrays to Serializer.serialize(Object, Object)
.
value
- The new value for this property.
public SerializerGroupBuilder useWhitespace(boolean value)
If
value
- The new value for this property.
public SerializerGroupBuilder useWhitespace()
Shortcut for calling useWhitespace(
.
public SerializerGroupBuilder ws()
Shortcut for calling useWhitespace(
.
public SerializerGroupBuilder detectRecursions(boolean value)
BeanTraverseBuilder
Specifies that recursions should be checked for during traversal.
detectRecursions
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder detectRecursions()
BeanTraverseBuilder
Shortcut for calling detectRecursions(
.
detectRecursions
in class BeanTraverseBuilder
public SerializerGroupBuilder ignoreRecursions(boolean value)
BeanTraverseBuilder
If
ignoreRecursions
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder ignoreRecursions()
BeanTraverseBuilder
Shortcut for calling ignoreRecursions(
.
ignoreRecursions
in class BeanTraverseBuilder
public SerializerGroupBuilder initialDepth(int value)
BeanTraverseBuilder
The initial indentation level at the root.
initialDepth
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder maxDepth(int value)
BeanTraverseBuilder
Abort traversal if specified depth is reached in the POJO tree.
If this depth is exceeded, an exception is thrown.
This prevents stack overflows from occurring when trying to traverse models with recursive references.
maxDepth
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder beanClassVisibility(Visibility value)
BeanContextBuilder
Classes are not considered beans unless they meet the minimum visibility requirements.
For example, if the visibility is
beanClassVisibility
in class BeanTraverseBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public SerializerGroupBuilder beanConstructorVisibility(Visibility value)
BeanContextBuilder
Only look for constructors with the specified minimum visibility.
beanConstructorVisibility
in class BeanTraverseBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public SerializerGroupBuilder beanDictionary(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but takes in an array of classes.
beanDictionary
in class BeanTraverseBuilder
values
- The values to add to this property.public SerializerGroupBuilder beanDictionary(Object... values)
BeanContextBuilder
Adds to the list of classes that make up the bean dictionary in this bean context.
beanDictionary
in class BeanTraverseBuilder
values
- The values to add to this property.public SerializerGroupBuilder beanDictionaryReplace(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but replaces the existing value.
beanDictionaryReplace
in class BeanTraverseBuilder
values
- The new values for this property.public SerializerGroupBuilder beanDictionaryReplace(Object... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but replaces the existing value.
beanDictionaryReplace
in class BeanTraverseBuilder
values
- The new values for this property.public SerializerGroupBuilder beanDictionaryRemove(Class<?>... values)
BeanContextBuilder
Removes from the list of classes that make up the bean dictionary in this bean context.
beanDictionaryRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.public SerializerGroupBuilder beanDictionaryRemove(Object... values)
BeanContextBuilder
Removes from the list of classes that make up the bean dictionary in this bean context.
beanDictionaryRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.public SerializerGroupBuilder beanFieldVisibility(Visibility value)
BeanContextBuilder
Only look for bean fields with the specified minimum visibility.
beanFieldVisibility
in class BeanTraverseBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public SerializerGroupBuilder beanFilters(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but takes in an array of classes.
beanFilters
in class BeanTraverseBuilder
values
- The values to add to this property.public SerializerGroupBuilder beanFilters(Object... values)
BeanContextBuilder
This is a programmatic equivalent to the @Bean
annotation.
It's useful when you want to use the Bean annotation functionality, but you don't have the ability to alter
the bean classes.
beanFilters
in class BeanTraverseBuilder
values
- The values to add to this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public SerializerGroupBuilder beanFiltersReplace(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but replaces the existing values.
beanFiltersReplace
in class BeanTraverseBuilder
values
- The new values for this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public SerializerGroupBuilder beanFiltersReplace(Object... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but replaces the existing values.
beanFiltersReplace
in class BeanTraverseBuilder
values
- The new values for this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public SerializerGroupBuilder beanFiltersRemove(Class<?>... values)
BeanContextBuilder
Removes from the list of classes that make up the bean filters in this bean context.
beanFiltersRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public SerializerGroupBuilder beanFiltersRemove(Object... values)
BeanContextBuilder
Removes from the list of classes that make up the bean filters in this bean context.
beanFiltersRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public SerializerGroupBuilder beanMapPutReturnsOldValue(boolean value)
BeanContextBuilder
If BeanMap.put()
method will return old property
values.
Otherwise, it returns
beanMapPutReturnsOldValue
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder beanMapPutReturnsOldValue()
BeanContextBuilder
Shortcut for calling beanMapPutReturnsOldValue(
.
beanMapPutReturnsOldValue
in class BeanTraverseBuilder
public SerializerGroupBuilder beanMethodVisibility(Visibility value)
BeanContextBuilder
Only look for bean methods with the specified minimum visibility.
beanMethodVisibility
in class BeanTraverseBuilder
value
- The new value for this property.
Visibility.PUBLIC
public SerializerGroupBuilder beansRequireDefaultConstructor(boolean value)
BeanContextBuilder
If
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireDefaultConstructor
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder beansRequireDefaultConstructor()
BeanContextBuilder
Shortcut for calling beansRequireDefaultConstructor(
.
beansRequireDefaultConstructor
in class BeanTraverseBuilder
public SerializerGroupBuilder beansRequireSerializable(boolean value)
BeanContextBuilder
If Serializable
interface to be considered a bean.
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireSerializable
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder beansRequireSerializable()
BeanContextBuilder
Shortcut for calling beansRequireSerializable(
.
beansRequireSerializable
in class BeanTraverseBuilder
public SerializerGroupBuilder beansRequireSettersForGetters(boolean value)
BeanContextBuilder
If
Otherwise, they will be ignored.
beansRequireSettersForGetters
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder beansRequireSettersForGetters()
BeanContextBuilder
Shortcut for calling beansRequireSettersForGetters(
.
beansRequireSettersForGetters
in class BeanTraverseBuilder
public SerializerGroupBuilder beansRequireSomeProperties(boolean value)
BeanContextBuilder
If
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireSomeProperties
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder beanTypePropertyName(String value)
BeanContextBuilder
This specifies the name of the bean property used to store the dictionary name of a bean type so that the parser knows the data type to reconstruct.
beanTypePropertyName
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder debug()
BeanContextBuilder
Shortcut for calling debug(
.
debug
in class BeanTraverseBuilder
public <T> SerializerGroupBuilder example(Class<T> c, T o)
BeanContextBuilder
Specifies an example of the specified class.
example
in class BeanTraverseBuilder
c
- The POJO class.o
- An instance of the POJO class used for examples.public <T> SerializerGroupBuilder exampleJson(Class<T> c, String value)
BeanContextBuilder
Specifies an example of the specified class.
exampleJson
in class BeanTraverseBuilder
T
- The POJO class type.c
- The POJO class.value
- The simple JSON representation of the example.public SerializerGroupBuilder ignoreInvocationExceptionsOnGetters(boolean value)
BeanContextBuilder
If BeanRuntimeException
is thrown.
ignoreInvocationExceptionsOnGetters
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder ignoreInvocationExceptionsOnGetters()
BeanContextBuilder
Shortcut for calling ignoreInvocationExceptionsOnGetters(
.
ignoreInvocationExceptionsOnGetters
in class BeanTraverseBuilder
public SerializerGroupBuilder ignoreInvocationExceptionsOnSetters(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreInvocationExceptionsOnSetters
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder ignoreInvocationExceptionsOnSetters()
BeanContextBuilder
Shortcut for calling ignoreInvocationExceptionsOnSetters(
.
ignoreInvocationExceptionsOnSetters
in class BeanTraverseBuilder
public SerializerGroupBuilder ignorePropertiesWithoutSetters(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignorePropertiesWithoutSetters
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder ignoreUnknownBeanProperties(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreUnknownBeanProperties
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder ignoreUnknownBeanProperties()
BeanContextBuilder
Shortcut for calling ignoreUnknownBeanProperties(
.
ignoreUnknownBeanProperties
in class BeanTraverseBuilder
public SerializerGroupBuilder ignoreUnknownNullBeanProperties(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreUnknownNullBeanProperties
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder implClass(Class<?> interfaceClass, Class<?> implClass)
BeanContextBuilder
implClass
in class BeanTraverseBuilder
interfaceClass
- The interface class.implClass
- The implementation class.public SerializerGroupBuilder implClasses(Map<String,Class<?>> values)
BeanContextBuilder
For interfaces and abstract classes this method can be used to specify an implementation class for the interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a parse).
implClasses
in class BeanTraverseBuilder
values
- The new value for this property.public SerializerGroupBuilder locale(Locale value)
BeanContextBuilder
Specifies a default locale for serializer and parser sessions.
locale
in class BeanTraverseBuilder
value
- The new value for this property.public SerializerGroupBuilder mediaType(MediaType value)
BeanContextBuilder
Specifies a default media type value for serializer and parser sessions.
mediaType
in class BeanTraverseBuilder
value
- The new value for this property.public SerializerGroupBuilder notBeanClasses(Class<?>... values)
BeanContextBuilder
List of classes that should not be treated as beans even if they appear to be bean-like.
Not-bean classes are converted to
notBeanClasses
in class BeanTraverseBuilder
values
- The values to add to this property.public SerializerGroupBuilder notBeanClasses(Object... values)
BeanContextBuilder
List of classes that should not be treated as beans even if they appear to be bean-like.
Not-bean classes are converted to
notBeanClasses
in class BeanTraverseBuilder
values
- The values to add to this property.
public SerializerGroupBuilder notBeanClassesReplace(Class<?>... values)
BeanContextBuilder
Not-bean classes are converted to
notBeanClassesReplace
in class BeanTraverseBuilder
values
- The new value for this property.public SerializerGroupBuilder notBeanClassesReplace(Object... values)
BeanContextBuilder
Not-bean classes are converted to
notBeanClassesReplace
in class BeanTraverseBuilder
values
- The new value for this property.
public SerializerGroupBuilder notBeanClassesRemove(Class<?>... values)
BeanContextBuilder
notBeanClassesRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.public SerializerGroupBuilder notBeanClassesRemove(Object... values)
BeanContextBuilder
notBeanClassesRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.
public SerializerGroupBuilder notBeanPackages(Object... values)
BeanContextBuilder
notBeanPackages
in class BeanTraverseBuilder
values
- The values to add to this property.
public SerializerGroupBuilder notBeanPackages(String... values)
BeanContextBuilder
notBeanPackages
in class BeanTraverseBuilder
values
- The values to add to this property.public SerializerGroupBuilder notBeanPackagesReplace(String... values)
BeanContextBuilder
notBeanPackagesReplace
in class BeanTraverseBuilder
values
- public SerializerGroupBuilder notBeanPackagesReplace(Object... values)
BeanContextBuilder
notBeanPackagesReplace
in class BeanTraverseBuilder
values
- public SerializerGroupBuilder notBeanPackagesRemove(String... values)
BeanContextBuilder
notBeanPackagesRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.public SerializerGroupBuilder notBeanPackagesRemove(Object... values)
BeanContextBuilder
notBeanPackagesRemove
in class BeanTraverseBuilder
values
- public SerializerGroupBuilder pojoSwaps(Class<?>... values)
BeanContextBuilder
pojoSwaps
in class BeanTraverseBuilder
values
- The values to add to this property.public SerializerGroupBuilder pojoSwaps(Object... values)
BeanContextBuilder
pojoSwaps
in class BeanTraverseBuilder
values
- The values to add to this property.
PojoSwap
.
SurrogateSwap
.
public SerializerGroupBuilder pojoSwapsReplace(Class<?>... values)
BeanContextBuilder
pojoSwapsReplace
in class BeanTraverseBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public SerializerGroupBuilder pojoSwapsReplace(Object... values)
BeanContextBuilder
pojoSwapsReplace
in class BeanTraverseBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public SerializerGroupBuilder pojoSwapsRemove(Class<?>... values)
BeanContextBuilder
pojoSwapsRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public SerializerGroupBuilder pojoSwapsRemove(Object... values)
BeanContextBuilder
pojoSwapsRemove
in class BeanTraverseBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public SerializerGroupBuilder sortProperties(boolean value)
BeanContextBuilder
When
sortProperties
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder sortProperties()
BeanContextBuilder
Shortcut for calling sortProperties(
.
sortProperties
in class BeanTraverseBuilder
public SerializerGroupBuilder timeZone(TimeZone value)
BeanContextBuilder
timeZone
in class BeanTraverseBuilder
value
- The new value for this property.public SerializerGroupBuilder useEnumNames(boolean value)
BeanContextBuilder
When enabled, enums are always serialized by name instead of using Object.toString()
.
useEnumNames
in class BeanTraverseBuilder
value
- The property value.public SerializerGroupBuilder useEnumNames()
BeanContextBuilder
When enabled, enums are always serialized by name instead of using Object.toString()
.
useEnumNames
in class BeanTraverseBuilder
public SerializerGroupBuilder useInterfaceProxies(boolean value)
BeanContextBuilder
If InvocationHandler
if there is no other way of instantiating them.
useInterfaceProxies
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder useJavaBeanIntrospector(boolean value)
BeanContextBuilder
Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
@Bean
annotations will be ignored if you enable this setting.
useJavaBeanIntrospector
in class BeanTraverseBuilder
value
- The new value for this property.
public SerializerGroupBuilder useJavaBeanIntrospector()
BeanContextBuilder
Shortcut for calling useJavaBeanIntrospector(
.
useJavaBeanIntrospector
in class BeanTraverseBuilder
public SerializerGroupBuilder set(String name, Object value)
ContextBuilder
set
in class BeanTraverseBuilder
name
- The property name.value
- The property value.PropertyStoreBuilder.set(String, Object)
public SerializerGroupBuilder set(Map<String,Object> properties)
ContextBuilder
set
in class BeanTraverseBuilder
properties
- The properties to set on this class.PropertyStoreBuilder.set(java.util.Map)
public SerializerGroupBuilder add(Map<String,Object> properties)
ContextBuilder
add
in class BeanTraverseBuilder
properties
- The properties to set on this class.PropertyStoreBuilder.add(java.util.Map)
public SerializerGroupBuilder addTo(String name, Object value)
ContextBuilder
addTo
in class BeanTraverseBuilder
name
- The property name.value
- The new value to add to the SET property.public SerializerGroupBuilder addTo(String name, String key, Object value)
ContextBuilder
addTo
in class BeanTraverseBuilder
name
- The property name.key
- The property value map key.value
- The property value map value.public SerializerGroupBuilder removeFrom(String name, Object value)
ContextBuilder
removeFrom
in class BeanTraverseBuilder
name
- The property name.value
- The property value in the SET property.public SerializerGroupBuilder apply(PropertyStore copyFrom)
ContextBuilder
apply
in class BeanTraverseBuilder
copyFrom
- The factory whose settings are being copied.public SerializerGroupBuilder applyAnnotations(AnnotationList al, VarResolverSession vrs)
ContextBuilder
applyAnnotations
in class BeanTraverseBuilder
al
- The list of all annotations annotated with PropertyStoreApply
.vrs
- The string resolver for resolving variables in annotation values.public SerializerGroupBuilder applyAnnotations(Class<?> fromClass)
ContextBuilder
Applies any of the following annotations:
BeanConfig
CsvConfig
HtmlConfig
HtmlDocConfig
JsoConfig
JsonConfig
JsonSchemaConfig
MsgPackConfig
OpenApiConfig
ParserConfig
PlainTextConfig
SerializerConfig
SoapXmlConfig
UonConfig
UrlEncodingConfig
XmlConfig
Annotations are appended in the following order:
applyAnnotations
in class BeanTraverseBuilder
fromClass
- The class on which the annotations are defined.public SerializerGroupBuilder applyAnnotations(Method fromMethod)
ContextBuilder
Applies any of the following annotations:
BeanConfig
CsvConfig
HtmlConfig
HtmlDocConfig
JsoConfig
JsonConfig
JsonSchemaConfig
MsgPackConfig
OpenApiConfig
ParserConfig
PlainTextConfig
SerializerConfig
SoapXmlConfig
UonConfig
UrlEncodingConfig
XmlConfig
Annotations are appended in the following orders:
applyAnnotations
in class BeanTraverseBuilder
fromMethod
- The method on which the annotations are defined.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.