Package org.apache.logging.log4j.util
Interface PropertySource
-
- All Known Implementing Classes:
EnvironmentPropertySource
,PropertiesPropertySource
,PropertyFilePropertySource
,SystemPropertiesPropertySource
public interface PropertySource
A source for global configuration properties.- Since:
- 2.10.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PropertySource.Comparator
Comparator for ordering PropertySource instances by priority.static class
PropertySource.Util
Utility methods useful for PropertySource implementations.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
forEach(BiConsumer<String,String> action)
Iterates over all properties and performs an action for each key/value pair.CharSequence
getNormalForm(Iterable<? extends CharSequence> tokens)
Converts a list of property name tokens into a normal form.int
getPriority()
Returns the order in which this PropertySource has priority.
-
-
-
Method Detail
-
getPriority
int getPriority()
Returns the order in which this PropertySource has priority. A higher value means that the source will be applied later so as to take precedence over other property sources.- Returns:
- priority value
-
forEach
void forEach(BiConsumer<String,String> action)
Iterates over all properties and performs an action for each key/value pair.- Parameters:
action
- action to perform on each key/value pair
-
getNormalForm
CharSequence getNormalForm(Iterable<? extends CharSequence> tokens)
Converts a list of property name tokens into a normal form. For example, a list of tokens such as "foo", "bar", "baz", might be normalized into the property name "log4j2.fooBarBaz".- Parameters:
tokens
- list of property name tokens- Returns:
- a normalized property name using the given tokens
-
-