public static final class OverrideSource.OverrideData extends Object
OverrideData supports the *
wildcard character which represents one or more regex word characters:
[a-zA-Z_0-9]. In particular the create(java.io.Reader) and
createFromWildcards(java.util.List<java.util.Map.Entry<java.lang.String, java.lang.String>>) static factory methods deal with pairs of
Strings; the first is a possible wildcard expression, and the
second is the replacement value the config system will use as it loads
any Config value node with a key that matches the wildcard
expression.
| Modifier and Type | Method and Description |
|---|---|
static OverrideSource.OverrideData |
create(List<Map.Entry<Predicate<Config.Key>,String>> data)
Creates
OverrideData from a List of
predicate/replacement pairs. |
static OverrideSource.OverrideData |
create(Reader reader)
Creates
OverrideData from a Reader. |
static OverrideSource.OverrideData |
createFromWildcards(List<Map.Entry<String,String>> wildcards)
Creates
OverrideData from a List of String
pairs. |
List<Map.Entry<Predicate<Config.Key>,String>> |
data()
Returns the predicate/replacement value pairs.
|
static OverrideSource.OverrideData |
empty()
Creates an
OverrideData object containing no overrides. |
public static OverrideSource.OverrideData create(List<Map.Entry<Predicate<Config.Key>,String>> data)
OverrideData from a List of
predicate/replacement pairs. This method does not use
wildcarding.data - the predicate/replacement pairsOverrideData containing the specified pairspublic static OverrideSource.OverrideData createFromWildcards(List<Map.Entry<String,String>> wildcards)
OverrideData from a List of String
pairs.
wildcards - List of pairs of
wildcard expressions and corresponding
replacement valuesOverrideData object containing the
Predicate/String pairs corresponding to the
wildcard/replacement pairspublic static OverrideSource.OverrideData create(Reader reader) throws IOException
OverrideData from a Reader.
The Reader should provide lines in Java
Properties file format. In each line the
String to the left of the = sign is either a
Config.Key or a
wildcard expressions as described
above. The String to the right of the = sign is the
replacement value.reader - a sourceIOException - when an error occurred when reading from the
readerpublic static OverrideSource.OverrideData empty()
OverrideData object containing no overrides.public List<Map.Entry<Predicate<Config.Key>,String>> data()
Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.