Class SystemPropertiesLookup
- java.lang.Object
-
- org.apache.commons.configuration2.interpol.SystemPropertiesLookup
-
- All Implemented Interfaces:
Lookup
public class SystemPropertiesLookup extends java.lang.Object implements Lookup
A specialized implementation of the
Lookup
interface that allows access to system properties.This implementation relies on
StrLookup.systemPropertiesLookup()
from the Commons Lang project to resolve system properties. It can be used for referencing system properties in configuration files in an easy way, for instance:current.user = ${sys:user.name}
SystemPropertiesLookup
is one of the standard lookups that is registered per default for each configuration.- Since:
- 2.0
- Version:
- $Id: SystemPropertiesLookup.java 1679786 2015-05-16 17:47:09Z oheger $
-
-
Constructor Summary
Constructors Constructor Description SystemPropertiesLookup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
lookup(java.lang.String variable)
Looks up the value of the specified variable.
-
-
-
Method Detail
-
lookup
public java.lang.Object lookup(java.lang.String variable)
Description copied from interface:Lookup
Looks up the value of the specified variable. This method is called byConfigurationInterpolator
with the variable name extracted from the expression to interpolate (i.e. the prefix name has already been removed). A concrete implementation has to return the value of this variable or null if the variable name is unknown.
-
-