public class ConfigFileStoreBuilder extends ConfigStoreBuilder
ConfigFileStore
objects.Constructor and Description |
---|
ConfigFileStoreBuilder()
Constructor, default settings.
|
ConfigFileStoreBuilder(PropertyStore ps)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ConfigFileStoreBuilder |
add(Map<String,Object> properties)
Adds multiple free-form configuration properties on this object without first clearing out any previous values.
|
ConfigFileStoreBuilder |
addTo(String name,
Object value)
Adds a free-form value to a SET property.
|
ConfigFileStoreBuilder |
appendTo(String name,
Object value)
Adds a free-form value to the end of a LIST property.
|
ConfigFileStoreBuilder |
apply(PropertyStore copyFrom)
Copies the settings from the specified property store into this builder.
|
ConfigFileStoreBuilder |
applyAnnotations(AnnotationList al,
VarResolverSession r)
Applies a set of annotations to this property store.
|
ConfigFileStoreBuilder |
applyAnnotations(Class<?>... fromClasses)
Applies any of the various
|
ConfigFileStoreBuilder |
applyAnnotations(Method... fromMethods)
Applies any of the various
|
ConfigFileStore |
build()
Build the object.
|
ConfigFileStoreBuilder |
charset(Charset value)
Configuration property: Charset.
|
ConfigFileStoreBuilder |
charset(String value)
Configuration property: Charset.
|
ConfigFileStoreBuilder |
debug()
|
ConfigFileStoreBuilder |
directory(File value)
Configuration property: Local file system directory.
|
ConfigFileStoreBuilder |
directory(String value)
Configuration property: Local file system directory.
|
ConfigFileStoreBuilder |
extensions(String value)
Configuration property: File extensions.
|
ConfigFileStoreBuilder |
locale(Locale value)
|
ConfigFileStoreBuilder |
mediaType(MediaType value)
|
ConfigFileStoreBuilder |
prependTo(String name,
Object value)
Adds a free-form value to the beginning of a LIST property.
|
ConfigFileStoreBuilder |
putAllTo(String name,
Object value)
Adds or overwrites multiple free-form entries in a MAP property.
|
ConfigFileStoreBuilder |
putTo(String name,
String key,
Object value)
Adds or overwrites a free-form entry in a MAP property.
|
ConfigFileStoreBuilder |
removeFrom(String name,
Object value)
Removes a free-form value from a SET, LIST, or MAP property.
|
ConfigFileStoreBuilder |
set(Map<String,Object> properties)
Sets multiple free-form configuration properties on this object replacing all previous values.
|
ConfigFileStoreBuilder |
set(String name,
Object value)
Sets a free-form configuration property on this object.
|
ConfigFileStoreBuilder |
timeZone(TimeZone value)
|
ConfigFileStoreBuilder |
updateOnWrite()
Configuration property: Update-on-write.
|
ConfigFileStoreBuilder |
useWatcher()
Configuration property: Use watcher.
|
ConfigFileStoreBuilder |
watcherSensitivity(String value)
Configuration property: Watcher sensitivity.
|
ConfigFileStoreBuilder |
watcherSensitivity(WatcherSensitivity value)
Configuration property: Watcher sensitivity.
|
build, getPropertyStore, getPropertyStoreBuilder, peek, peek
public ConfigFileStoreBuilder()
public ConfigFileStoreBuilder(PropertyStore ps)
ps
- The initial configuration settings for this builder.public ConfigFileStore build()
ContextBuilder
build
in class ConfigStoreBuilder
public ConfigFileStoreBuilder directory(String value)
Identifies the path of the directory containing the configuration files.
value
- The new value for this property.
public ConfigFileStoreBuilder directory(File value)
Identifies the path of the directory containing the configuration files.
value
- The new value for this property.
public ConfigFileStoreBuilder charset(String value)
Identifies the charset of external files.
value
- The new value for this property.
public ConfigFileStoreBuilder charset(Charset value)
Identifies the charset of external files.
value
- The new value for this property.
public ConfigFileStoreBuilder useWatcher()
Shortcut for calling useWatcher(
.
public ConfigFileStoreBuilder watcherSensitivity(WatcherSensitivity value)
Determines how frequently the file system is polled for updates.
value
- The new value for this property.
WatcherSensitivity.MEDIUM
public ConfigFileStoreBuilder updateOnWrite()
Shortcut for calling useWatcher(
.
public ConfigFileStoreBuilder watcherSensitivity(String value)
Determines how frequently the file system is polled for updates.
value
- The new value for this property.
WatcherSensitivity.MEDIUM
public ConfigFileStoreBuilder extensions(String value)
Defines what file extensions to search for when the config name does not have an extension.
value
- The new value for this property.
public ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder apply(PropertyStore copyFrom)
ContextBuilder
apply
in class ConfigStoreBuilder
copyFrom
- The property store whose settings are being copied.public ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder debug()
ContextBuilder
Enables the following additional information during serialization:
BeanTraverseContext.BEANTRAVERSE_detectRecursions
.
Enables the following additional information during parsing:
debug
in class ConfigStoreBuilder
public ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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 ConfigFileStoreBuilder 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.