Class Config.Builder
- Enclosing class:
- Config
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor, default settings.protectedCopy constructor.protectedBuilder(Config.Builder copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbinaryFormat(BinaryFormat value) Binary value format.binaryLineLength(int value) Binary value line length.build()Build the object.copy()Copy creator.format(ConfigFormat value) Configuration format.ini()Sets INI format.memStore()Configuration store.Adds a value modifier.Multi-line values on separate lines.Configuration name.parser(ReaderParser value) POJO parser.Active configuration profiles.readOnly()Read-only mode.serializer(WriterSerializer value) POJO serializer.store(ConfigStore value) Configuration store.varResolver(VarResolver value) SVL variable resolver.yaml()Sets YAML format.Methods inherited from class org.apache.juneau.marshall.Context.Builder
annotations, annotations, apply, applyAnnotations, applyAnnotations, asSubtype, build, cache, canApply, copyOrNull, debug, debug, getApplied, getType, hashKey, 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
-
binaryFormat
Binary value format.The format to use when persisting byte arrays.
BinaryFormat.BASE64- BASE64-encoded string.BinaryFormat.HEX- Hexadecimal.BinaryFormat.SPACED_HEX- Hexadecimal with spaces between bytes.
- Parameters:
value- The new value for this property.
The default is the first value found:- System property
"Config.binaryFormat" - Environment variable
"CONFIG_BINARYFORMAT" BinaryFormat.BASE64
Cannot benull .- System property
- Returns:
- This object.
-
binaryLineLength
Binary value line length.When serializing binary values, lines will be split after this many characters.
Use-1 to represent no line splitting.- Parameters:
value- The new value for this property.
The default is the first value found:- System property
"Config.binaryLineLength" - Environment variable
"CONFIG_BINARYLINELENGTH" -1
- System property
- Returns:
- This object.
-
build
Description copied from class:Context.BuilderBuild the object.- Overrides:
buildin classContext.Builder<Config.Builder>- Returns:
- The built object.
-
copy
Description copied from class:Context.BuilderCopy creator.- Specified by:
copyin classContext.Builder<Config.Builder>- Returns:
- A new mutable copy of this builder.
-
memStore
Configuration store.Convenience method for calling
store(ConfigMemoryStore..DEFAULT )- Returns:
- This object.
-
mods
Adds a value modifier.Modifiers are used to modify entry value before being persisted.
- Parameters:
values- The mods to apply to this config.
Cannot containnull values.- Returns:
- This object.
-
multiLineValuesOnSeparateLines
Multi-line values on separate lines.When enabled, multi-line values will always be placed on a separate line from the key.
The default is the first value found:
- System property
"Config.multiLineValuesOnSeparateLine" - Environment variable
"CONFIG_MULTILINEVALUESONSEPARATELINE" false
- Returns:
- This object.
- System property
-
name
Configuration name.Specifies the configuration name.
This is typically the configuration file name, although the name can be anything identifiable by theConfigStoreused for retrieving and storing the configuration.- Parameters:
value- The new value for this property.
The default is the first value found:- System property
"Config.name" - Environment variable
"CONFIG_NAME" "Configuration.cfg"
Cannot benull .- System property
- Returns:
- This object.
-
profiles
Active configuration profiles.Each active profile
Pactivates a<name>-Poverlay (e.g. basemy.cfg+ profilestage→my-stage.cfg) layered over the base config: profile entries win over base, and for multiple active profiles the last one wins. YAML bases use<name>-P.ymloverlays the same way. Overlays are resolved through the configuredstore, so live-reload fires when either the base or an active profile file changes.Defaults to the comma-separated value of
juneau.profiles.active(system property, environment variable — with relaxed binding — or config key). Pass no arguments / an empty array to disable profiles.- Parameters:
value- The active profile names, in activation order.
May be empty.
Can benull (treated as no active profiles).- Returns:
- This object.
- Since:
- 10.0.0
-
format
Configuration format.- Parameters:
value- The format. Can benull to auto-detect from the config name extension.- Returns:
- This object.
-
yaml
Sets YAML format.- Returns:
- This object.
-
ini
Sets INI format.- Returns:
- This object.
-
parser
POJO parser.The parser to use for parsing values to POJOs.
- Parameters:
value- The new value for this property.
The default isJsonParser.DEFAULT.
Cannot benull .- Returns:
- This object.
-
readOnly
Read-only mode.When enabled, attempts to call any setters on this object will throw an
UnsupportedOperationException.The default is the first value found:
- System property
"Config.readOnly" - Environment variable
"CONFIG_READONLY" false
- Returns:
- This object.
- System property
-
serializer
POJO serializer.The serializer to use for serializing POJO values.
- Parameters:
value- The new value for this property.
The default isJson5Serializer.DEFAULT
Cannot benull .- Returns:
- This object.
-
store
Configuration store.The configuration store used for retrieving and storing configurations.
- Parameters:
value- The new value for this property.
The default isFileStore.DEFAULT.
Cannot benull .- Returns:
- This object.
-
varResolver
SVL variable resolver.The resolver to use for resolving SVL variables.
- Parameters:
value- The new value for this property.
The default isVarResolver.DEFAULT.
Cannot benull .- Returns:
- This object.
-