public class InterpolationProperties extends Object
Interpolation means the substitution of a string of the form ${some.property} with the value of the property called "some.property".
Interpolation is performed repeatedly, so can values can contain new interpolations. Infinite loops are supported. This is not a feature.
Modifier and Type | Field and Description |
---|---|
protected Properties |
theProperties
the properties
|
Constructor and Description |
---|
InterpolationProperties()
Create Empty
|
InterpolationProperties(Properties theProperties)
Load with existing Properties
|
InterpolationProperties(String identifier)
Load properties from a configuration file.
|
Modifier and Type | Method and Description |
---|---|
String |
getProperty(String propName)
Retrieve Property
|
String |
interpolate(String input)
Interpolate all the properties in the input string.
|
protected static Properties |
loadProperties(String identifier)
Load properties from a configuration file.
|
void |
putAll(InterpolationProperties other)
Copy all properties from another
InterpolationProperties into this one. |
static String |
readAll(InputStream input)
Read everything from an input stream into a String, reconstructing line endings.
|
void |
setProperty(String propName,
String value)
Set Property
|
protected Properties theProperties
public InterpolationProperties(Properties theProperties)
theProperties
- propertiespublic InterpolationProperties(String identifier)
The name of the properties file is constructed by appending ".properties" to the identifier. If there is a system property with the name of this property file, it is used as a file to load, otherwise the property file is loaded from the root of the classpath.
For example, if the identifier is app-schema:
identifier
- string used to construct property file namepublic InterpolationProperties()
public void setProperty(String propName, String value)
propName
- property namepublic String getProperty(String propName)
propName
- property namepublic String interpolate(String input)
Properties are of the form ${some.property}, for which the value of property "some.property" is used.
It is an error for interpolated properties to not exist. A RuntimeException
is
thrown if the value of a referenced property is null.
properties
- properties to be interpolatedinput
- string on which interpolation is to be performedprotected static Properties loadProperties(String identifier)
The name of the properties file is constructed by appending ".properties" to the identifier. If there is a system property with the name of this property file, it is used as a file to load, otherwise the property file is loaded from the root of the classpath.
For example, if the identifier is app-schema:
identifier
- string used to construct property file namepublic static String readAll(InputStream input)
input
- the stream to be readpublic void putAll(InterpolationProperties other)
InterpolationProperties
into this one.other
- the source InterpolationProperties
.Copyright © 1996–2019 Geotools. All rights reserved.