public final class PropertyResolvers extends Object
Modifier and Type | Method and Description |
---|---|
static PropertyResolver |
bootstrapPropertyResolver(String productKey,
PropertyResolver productPathResolver)
Get the standard bootstrap property resolver, which is defined as a resolver that checks in turn:
The product paths resolver
Environment variables
System properties
Any external sources defined in the <productKey>.envconfig.dirs system property, or (if
it does not exist) the <PRODUCTKEY>_ENVCONFIG_DIRS environment variable, which is treated as a
comma-separated list of source directories, where the files in a directory are resolved in a
non-deterministic order, and are checked for duplicate keys.
|
static PropertyResolver |
defaultingPropertyResolver()
Returns an empty resolver that always return the default value.
|
static PropertyResolver |
environmentVariablePropertyResolver()
Construct a new
EnvironmentVariableResolver . |
static PropertyResolver |
jsonResolver(File jsonFile)
Construct a new
JsonValueResolver using a given file. |
static PropertyResolver |
jsonResolver(JsonValue json)
Construct a new
JsonValueResolver using a given a JsonValue . |
static PropertyResolver |
jsonResolver(Path path)
Construct a new
JsonValueResolver using a file at the given path. |
static PropertyResolver |
jsonResolver(String filename)
Construct a new
JsonValueResolver using the given filename. |
static PropertyResolver |
jsonResolver(String name,
JsonValue json)
Construct a new
JsonValueResolver using a given a JsonValue . |
static PropertyResolver |
pathPropertyResolver(Map<String,Path> directories)
Constructs a path resolver to expose paths and associated URLs.
|
static PropertyResolver |
prefixed(String prefix,
PropertyResolver delegate)
Constructs a prefixed
PropertyResolver . |
static PropertyResolver |
productPathPropertyResolver(String productKey,
Path instanceDirectory)
Constructs a path resolver to expose a product instance directory.
|
static PropertyResolver |
propertiesResolver(File propertiesFile)
Creates a
PropertiesResolver given a file object. |
static PropertyResolver |
propertiesResolver(Path filename)
Creates a
PropertiesResolver given a file location. |
static PropertyResolver |
propertiesResolver(Properties properties)
Creates a
PropertiesResolver given a Properties object. |
static PropertyResolver |
propertiesResolver(String filename)
Creates a
PropertiesResolver given a file location. |
static PropertyResolver |
propertiesResolver(String name,
Properties properties)
Creates a
PropertiesResolver given a Properties object. |
static PropertyResolver |
singletonPropertyResolver(String key,
String value)
Returns a resolver that knows only to resolve the given key.
|
static PropertyResolver |
systemPropertyResolver()
Construct a new
SystemPropertyResolver . |
public static PropertyResolver defaultingPropertyResolver()
public static PropertyResolver singletonPropertyResolver(String key, String value)
key
- the only resolvable keyvalue
- the key's valuepublic static PropertyResolver bootstrapPropertyResolver(String productKey, PropertyResolver productPathResolver)
productKey
- Product key (AM, IG, lowercased) to get the appropriate .envconfig.dirs value.productPathResolver
- A resolver that resolves the product installation details, etc.
This resolver might also provide a value for the
<productKey>.envconfig.dirs, if the product has an additional mechanism
for obtaining that value.SubstitutionService.SubstitutionService(PropertyResolver)
constructor, or extended by a product as
required.public static PropertyResolver environmentVariablePropertyResolver()
EnvironmentVariableResolver
.EnvironmentVariableResolver
public static PropertyResolver systemPropertyResolver()
SystemPropertyResolver
.SystemPropertyResolver
public static PropertyResolver jsonResolver(String filename)
JsonValueResolver
using the given filename.filename
- The name of the file to obtain the JSON from.JsonValueResolver
public static PropertyResolver jsonResolver(Path path)
JsonValueResolver
using a file at the given path.path
- The path of the file to obtain the JSON from.JsonValueResolver
public static PropertyResolver jsonResolver(File jsonFile)
JsonValueResolver
using a given file.jsonFile
- the file to obtain the JSON from.JsonValueResolver
public static PropertyResolver jsonResolver(JsonValue json)
JsonValueResolver
using a given a JsonValue
.json
- The JsonValue
for this resolverJsonValueResolver
public static PropertyResolver jsonResolver(String name, JsonValue json)
JsonValueResolver
using a given a JsonValue
.name
- The name of the JsonValueResolver
json
- The JsonValue
for this resolverJsonValueResolver
public static PropertyResolver propertiesResolver(Path filename)
PropertiesResolver
given a file location.filename
- the file to obtain the Properties
from.PropertiesResolver
public static PropertyResolver propertiesResolver(String filename)
PropertiesResolver
given a file location.filename
- the file to obtain the Properties
from.PropertiesResolver
public static PropertyResolver propertiesResolver(File propertiesFile)
PropertiesResolver
given a file object.propertiesFile
- the properties file as a File
object.PropertiesResolver
public static PropertyResolver propertiesResolver(Properties properties)
PropertiesResolver
given a Properties
object.properties
- the properties as a Properties
object.PropertiesResolver
public static PropertyResolver propertiesResolver(String name, Properties properties)
PropertiesResolver
given a Properties
object.name
- the name of the PropertiesResolver
.properties
- the properties as a Properties
object.PropertiesResolver
public static PropertyResolver prefixed(String prefix, PropertyResolver delegate)
PropertyResolver
.prefix
- prefix (not null
)delegate
- delegate resolver (not null
)public static PropertyResolver pathPropertyResolver(Map<String,Path> directories)
directories
- The directories to expose, cannot be null
.ProductPathResolver
public static PropertyResolver productPathPropertyResolver(String productKey, Path instanceDirectory)
productKey
- Used as a prefix for computed key names (lowercased)instanceDirectory
- The instance directory of this product, cannot be null
.ProductPathResolver
Copyright © 2010-2018, ForgeRock All Rights Reserved.