|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.complex.config.PropertyInterpolationUtils
public class PropertyInterpolationUtils
Utility methods to support interpolation of properties in a file.
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.
Constructor Summary | |
---|---|
PropertyInterpolationUtils()
|
Method Summary | |
---|---|
static java.lang.String |
interpolate(java.util.Properties properties,
java.lang.String input)
Interpolate all the properties in the input string. |
static java.util.Properties |
loadProperties(java.lang.String identifier)
Load properties from a configuration file. |
static java.lang.String |
readAll(java.io.InputStream input)
Read everything from an input stream into a String, reconstructing line endings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyInterpolationUtils()
Method Detail |
---|
public static java.lang.String interpolate(java.util.Properties properties, java.lang.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 performed
public static java.util.Properties loadProperties(java.lang.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 name
public static java.lang.String readAll(java.io.InputStream input)
input
- the stream to be read
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |