public class ConfigMemoryStoreBuilder extends ConfigStoreBuilder
ConfigMemoryStore
objects.Constructor and Description |
---|
ConfigMemoryStoreBuilder()
Constructor, default settings.
|
ConfigMemoryStoreBuilder(PropertyStore ps)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ConfigMemoryStoreBuilder |
add(Map<String,Object> properties)
Adds multiple free-form configuration properties on this object without first clearing out any previous values.
|
ConfigMemoryStoreBuilder |
addTo(String name,
Object value)
Adds a free-form value to a SET property.
|
ConfigMemoryStoreBuilder |
appendTo(String name,
Object value)
Adds a free-form value to the end of a LIST property.
|
ConfigMemoryStoreBuilder |
apply(PropertyStore copyFrom)
Copies the settings from the specified property store into this builder.
|
ConfigMemoryStoreBuilder |
applyAnnotations(AnnotationList al,
VarResolverSession r)
Applies a set of annotations to this property store.
|
ConfigMemoryStoreBuilder |
applyAnnotations(Class<?>... fromClasses)
Applies any of the various
|
ConfigMemoryStoreBuilder |
applyAnnotations(Method... fromMethods)
Applies any of the various
|
ConfigMemoryStore |
build()
Build the object.
|
ConfigMemoryStoreBuilder |
debug()
|
ConfigMemoryStoreBuilder |
locale(Locale value)
|
ConfigMemoryStoreBuilder |
mediaType(MediaType value)
|
ConfigMemoryStoreBuilder |
prependTo(String name,
Object value)
Adds a free-form value to the beginning of a LIST property.
|
ConfigMemoryStoreBuilder |
putAllTo(String name,
Object value)
Adds or overwrites multiple free-form entries in a MAP property.
|
ConfigMemoryStoreBuilder |
putTo(String name,
String key,
Object value)
Adds or overwrites a free-form entry in a MAP property.
|
ConfigMemoryStoreBuilder |
removeFrom(String name,
Object value)
Removes a free-form value from a SET, LIST, or MAP property.
|
ConfigMemoryStoreBuilder |
set(Map<String,Object> properties)
Sets multiple free-form configuration properties on this object replacing all previous values.
|
ConfigMemoryStoreBuilder |
set(String name,
Object value)
Sets a free-form configuration property on this object.
|
ConfigMemoryStoreBuilder |
timeZone(TimeZone value)
|
build, getPropertyStore, getPropertyStoreBuilder, peek, peek
public ConfigMemoryStoreBuilder()
public ConfigMemoryStoreBuilder(PropertyStore ps)
ps
- The initial configuration settings for this builder.public ConfigMemoryStore build()
ContextBuilder
build
in class ConfigStoreBuilder
public ConfigMemoryStoreBuilder add(Map<String,Object> properties)
ContextBuilder
Identical in function to ContextBuilder.set(String, Object)
but allows you to specify multiple values at once.
add
in class ConfigStoreBuilder
properties
- The properties to set on this class.
public ConfigMemoryStoreBuilder addTo(String name, Object value)
ContextBuilder
SET properties are those properties with one of the following type parts:
For example, the BeanContext.BEAN_notBeanClasses
property which has the value
addTo
in class ConfigStoreBuilder
name
- The property name.value
- The new value to add to the SET property.
public ConfigMemoryStoreBuilder appendTo(String name, Object value)
ContextBuilder
LIST properties are those properties with one of the following type parts:
For example, the BeanContext.BEAN_swaps
property which has the value
appendTo
in class ConfigStoreBuilder
name
- The property name.value
- The new value to add to the LIST property.
public ConfigMemoryStoreBuilder apply(PropertyStore copyFrom)
ContextBuilder
apply
in class ConfigStoreBuilder
copyFrom
- The property store whose settings are being copied.public ConfigMemoryStoreBuilder applyAnnotations(Class<?>... fromClasses)
ContextBuilder
Any annotations found that themselves are annotated with PropertyStoreApply
will be resolved and
applied as properties to this builder. These annotations include:
BeanConfig
CsvConfig
HtmlConfig
HtmlDocConfig
JsoConfig
JsonConfig
JsonSchemaConfig
MsgPackConfig
OpenApiConfig
ParserConfig
PlainTextConfig
SerializerConfig
SoapXmlConfig
UonConfig
UrlEncodingConfig
XmlConfig
Annotations on classes are appended in the following order:
The default var resolver VarResolver.DEFAULT
is used to resolve any variables in annotation field values.
applyAnnotations
in class ConfigStoreBuilder
fromClasses
- The classes on which the annotations are defined.public ConfigMemoryStoreBuilder applyAnnotations(Method... fromMethods)
ContextBuilder
Any annotations found that themselves are annotated with PropertyStoreApply
will be resolved and
applied as properties to this builder. These annotations include:
BeanConfig
CsvConfig
HtmlConfig
HtmlDocConfig
JsoConfig
JsonConfig
JsonSchemaConfig
MsgPackConfig
OpenApiConfig
ParserConfig
PlainTextConfig
SerializerConfig
SoapXmlConfig
UonConfig
UrlEncodingConfig
XmlConfig
Annotations on methods are appended in the following order:
The default var resolver VarResolver.DEFAULT
is used to resolve any variables in annotation field values.
applyAnnotations
in class ConfigStoreBuilder
fromMethods
- The methods on which the annotations are defined.public ConfigMemoryStoreBuilder applyAnnotations(AnnotationList al, VarResolverSession r)
ContextBuilder
The AnnotationList
object is an ordered list of annotations and the classes/methods/packages they were found on.
applyAnnotations
in class ConfigStoreBuilder
al
- The list of all annotations annotated with PropertyStoreApply
.r
- The string resolver for resolving variables in annotation values.public ConfigMemoryStoreBuilder debug()
ContextBuilder
Enables the following additional information during serialization:
BeanTraverseContext.BEANTRAVERSE_detectRecursions
.
Enables the following additional information during parsing:
debug
in class ConfigStoreBuilder
public ConfigMemoryStoreBuilder locale(Locale value)
ContextBuilder
Specifies the default locale for serializer and parser sessions when not specified via SessionArgs.locale(Locale)
.
Typically used for POJO swaps that need to deal with locales such as swaps that convert PojoSwap.swap(BeanSession, Object)
and
PojoSwap.unswap(BeanSession, Object, ClassMeta, String)
methods.
locale
in class ConfigStoreBuilder
value
- The new value for this property.public ConfigMemoryStoreBuilder mediaType(MediaType value)
ContextBuilder
Specifies the default media type for serializer and parser sessions when not specified via SessionArgs.mediaType(MediaType)
.
Typically used for POJO swaps that need to serialize the same POJO classes differently depending on
the specific requested media type. For example, a swap could handle a request for media types
mediaType
in class ConfigStoreBuilder
value
- The new value for this property.public ConfigMemoryStoreBuilder prependTo(String name, Object value)
ContextBuilder
LIST properties are those properties with one of the following type parts:
For example, the BeanContext.BEAN_swaps
property which has the value
prependTo
in class ConfigStoreBuilder
name
- The property name.value
- The new value to add to the LIST property.
public ConfigMemoryStoreBuilder putAllTo(String name, Object value)
ContextBuilder
MAP properties are those properties with one of the following type parts:
For example, the BeanContext.BEAN_implClasses
property which has the value
putAllTo
in class ConfigStoreBuilder
name
- The property name.value
- Either a JSON Object string or a Map
whose valid value types depend on the property type:
public ConfigMemoryStoreBuilder putTo(String name, String key, Object value)
ContextBuilder
MAP properties are those properties with one of the following type parts:
For example, the BeanContext.BEAN_implClasses
property which has the value
putTo
in class ConfigStoreBuilder
name
- The property name.key
- The property value map key.value
- The property value map value.
public ConfigMemoryStoreBuilder removeFrom(String name, Object value)
ContextBuilder
removeFrom
in class ConfigStoreBuilder
name
- The property name.value
- The property value in the SET/LIST/MAP property.public ConfigMemoryStoreBuilder set(Map<String,Object> properties)
ContextBuilder
Identical in function to ContextBuilder.set(String, Object)
but allows you to specify multiple values at once.
set
in class ConfigStoreBuilder
properties
- The properties to set on this class.
public ConfigMemoryStoreBuilder set(String name, Object value)
ContextBuilder
Provides the ability to specify configuration property values in a generic fashion.
Property names must have the following format that identify their datatype...
...where the parts consist of the following...
For example,
Property values get 'normalized' when they get set.
For example, calling PropertyStore
class to be comparable
and useful in determining whether a cached instance of a context object can be returned.
As a general rule, builders don't typically have "unsetter" methods. For example, once you've set strict
mode on the
set
in class ConfigStoreBuilder
name
- The property name.value
- The property value.
public ConfigMemoryStoreBuilder timeZone(TimeZone value)
ContextBuilder
Specifies the default time zone for serializer and parser sessions when not specified via SessionArgs.timeZone(TimeZone)
.
Typically used for POJO swaps that need to deal with timezones such as swaps that convert PojoSwap.swap(BeanSession, Object)
and
PojoSwap.unswap(BeanSession, Object, ClassMeta, String)
methods.
timeZone
in class ConfigStoreBuilder
value
- The new value for this property.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.