Top Description Fields Constructors Methods
org.apache.logging.log4j.util

public Class SystemPropertiesPropertySource

extends Object
implements PropertySource
Class Inheritance
All Implemented Interfaces
org.apache.logging.log4j.util.PropertySource
Annotations
@ServiceProvider:PropertySource
resolution:optional
Imports
aQute.bnd.annotation.Resolution, aQute.bnd.annotation.spi.ServiceProvider, java.util.Collection, .Objects, .Properties

PropertySource backed by the current system properties. Other than having a higher priority over normal properties, this follows the same rules as PropertiesPropertySource.
Since
2.10.0

Field Summary

Modifier and TypeField and Description
private static final int
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
containsProperty(final String
The key to search for.
key
)

Overrides default org.apache.logging.log4j.util.PropertySource.containsProperty.

For PropertySources that cannot iterate over all the potential properties this provides a direct lookup.

public void
forEach(final BiConsumer<String, String>
action to perform on each key/value pair
action
)

Overrides default org.apache.logging.log4j.util.PropertySource.forEach.

Iterates over all properties and performs an action for each key/value pair.

public CharSequence
getNormalForm(final Iterable<? extends CharSequence>
list of property name tokens
tokens
)

Overrides default org.apache.logging.log4j.util.PropertySource.getNormalForm.

Converts a list of property name tokens into a normal form.

public int
getPriority()

Implements org.apache.logging.log4j.util.PropertySource.getPriority.

Returns the order in which this PropertySource has priority.

public String
getProperty(final String
The key to search for.
key
)

Overrides default org.apache.logging.log4j.util.PropertySource.getProperty.

For PropertySources that cannot iterate over all the potential properties this provides a direct lookup.

public Collection<String>
getPropertyNames()

Overrides default org.apache.logging.log4j.util.PropertySource.getPropertyNames.

Returns the list of all property names.

public static String
getSystemProperty(final String key, final String defaultValue)

Used by bootstrap code to get system properties without loading PropertiesUtil.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_PRIORITYback to summary
private static final int DEFAULT_PRIORITY
PREFIXback to summary
private static final String PREFIX

Constructor Detail

SystemPropertiesPropertySourceback to summary
public SystemPropertiesPropertySource()

Method Detail

containsPropertyback to summary
public boolean containsProperty(final String key)

Overrides default org.apache.logging.log4j.util.PropertySource.containsProperty.

Doc from org.apache.logging.log4j.util.PropertySource.containsProperty.

For PropertySources that cannot iterate over all the potential properties this provides a direct lookup.

Parameters
key:String

The key to search for.

Returns:boolean

The value or null;

Annotations
@Override
forEachback to summary
public void forEach(final BiConsumer<String, String> action)

Overrides default org.apache.logging.log4j.util.PropertySource.forEach.

Doc from org.apache.logging.log4j.util.PropertySource.forEach.

Iterates over all properties and performs an action for each key/value pair.

Parameters
action:BiConsumer<String, String>

action to perform on each key/value pair

Annotations
@Override
getNormalFormback to summary
public CharSequence getNormalForm(final Iterable<? extends CharSequence> tokens)

Overrides default org.apache.logging.log4j.util.PropertySource.getNormalForm.

Doc from org.apache.logging.log4j.util.PropertySource.getNormalForm.

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:Iterable<? extends CharSequence>

list of property name tokens

Returns:CharSequence

a normalized property name using the given tokens

Annotations
@Override
getPriorityback to summary
public int getPriority()

Implements org.apache.logging.log4j.util.PropertySource.getPriority.

Doc from org.apache.logging.log4j.util.PropertySource.getPriority.

Returns the order in which this PropertySource has priority. A higher value means that the source will be searched later and can be overridden by other property sources.

Returns:int

priority value

Annotations
@Override
getPropertyback to summary
public String getProperty(final String key)

Overrides default org.apache.logging.log4j.util.PropertySource.getProperty.

Doc from org.apache.logging.log4j.util.PropertySource.getProperty.

For PropertySources that cannot iterate over all the potential properties this provides a direct lookup.

Parameters
key:String

The key to search for.

Returns:String

The value or null;

Annotations
@Override
getPropertyNamesback to summary
public Collection<String> getPropertyNames()

Overrides default org.apache.logging.log4j.util.PropertySource.getPropertyNames.

Doc from org.apache.logging.log4j.util.PropertySource.getPropertyNames.

Returns the list of all property names.

Returns:Collection<String>

list of property names

Annotations
@Override
getSystemPropertyback to summary
public static String getSystemProperty(final String key, final String defaultValue)

Used by bootstrap code to get system properties without loading PropertiesUtil.