|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ebmwebsourcing.easycommons.properties.PropertiesHelper
public final class PropertiesHelper
Utility to handle a CDK properties file.
| Constructor Summary | |
|---|---|
PropertiesHelper()
|
|
| Method Summary | |
|---|---|
static boolean |
containsPlaceHolder(java.lang.String str)
Test if the specified string contains at least one place holder |
static java.util.Properties |
flattenProperties(java.util.Properties properties)
Get a flat view of a Properties object including recursively,
default properties if any. |
static java.lang.String[] |
parsePropertyValues(java.lang.String propValue)
Parse the values of a property. |
static void |
resolveMap(java.util.Map<java.lang.String,java.lang.String> mapToResolve,
java.util.Properties propertiesToUse)
Resolve the place holders in the values of the specified Map
mapToResolve against the specified Properties propertiesToUse. |
static void |
resolveMapWithNoException(java.util.Map<java.lang.String,java.lang.String> mapToResolve,
java.util.Properties propertiesToUse)
Resolve the place holders in the values of the specified Map
mapToResolve against the specified Properties propertiesToUse. |
static void |
resolveProperties(java.util.Properties propertiesToResolve,
java.util.Properties propertiesToUse)
Resolve the specified Properties propertiesToResolve against the
specified Properties propertiesToUse. |
static java.io.ByteArrayInputStream |
resolvePropertiesForInputStream(java.io.InputStream inputStreamToResolve,
java.util.Properties propertiesToUse)
Resolve the place holders in the values of the specified InputStream inputStreamToResolve against the specified
Properties propertiesToUse. |
static java.lang.String |
resolveString(java.lang.String str,
java.util.Properties propertiesToUse)
Replace the place holders by their values in the specified string str. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertiesHelper()
| Method Detail |
|---|
public static final void resolveProperties(java.util.Properties propertiesToResolve,
java.util.Properties propertiesToUse)
throws PropertiesException
Properties propertiesToResolve against the
specified Properties propertiesToUse. If the place holders of a
property value cannot be resolved, the place holders are not replaced in
the resulting resulting value.
propertiesToResolve - the Properties to resolve (which contain place
holders)propertiesToUse - the Properties to use to resolve
PropertiesException - if an error occurs when resolving the Properties (if
there is a place holder loop in the specified
Properties)
public static final java.io.ByteArrayInputStream resolvePropertiesForInputStream(java.io.InputStream inputStreamToResolve,
java.util.Properties propertiesToUse)
throws PropertiesException,
java.io.IOException
InputStream inputStreamToResolve against the specified
Properties propertiesToUse. If the place holders of a property
value cannot be resolved, the place holders are not replaced in the
resulting resulting value.
inputStreamToResolve - the InputStream containing properties value with place
holders to resolvepropertiesToUse - the Properties to use to resolve
PropertiesException - if an error occurs when resolving the Properties (if
there is a place holder loop in the specified
Properties)
java.io.IOException - if an error occurred when reading from the specified input
stream or if writing this resolved property list to the
specified output stream throws an IOException.
public static final void resolveMapWithNoException(java.util.Map<java.lang.String,java.lang.String> mapToResolve,
java.util.Properties propertiesToUse)
Map
mapToResolve against the specified Properties propertiesToUse. If
the resolution of place holders fails, the string value is not modified
in the map.
mapToResolve - the Map containing string value with place holders to
resolvepropertiesToUse - the Properties to use to resolve
public static final void resolveMap(java.util.Map<java.lang.String,java.lang.String> mapToResolve,
java.util.Properties propertiesToUse)
throws PropertiesException
Map
mapToResolve against the specified Properties propertiesToUse. If
the place holders of a string value cannot be resolved, the place holders
are not replaced in the resulting string (only the resolved place holders
are replaced, not the others).
mapToResolve - the Map containing string value with place holders to
resolvepropertiesToUse - the Properties to use to resolve
PropertiesException - if an error occurs when resolving the Properties (if
there is a place holder loop in the specified
Properties)
public static final java.lang.String resolveString(java.lang.String str,
java.util.Properties propertiesToUse)
throws PropertiesException
str - a string containing place holderspropertiesToUse - the Properties to resolve (which contains place
holders)
PropertiesException - if an error occurs when resolving a place holder (if there is
a place holder loop in the specified Properties)public static final boolean containsPlaceHolder(java.lang.String str)
str - a string
public static final java.util.Properties flattenProperties(java.util.Properties properties)
Properties object including recursively,
default properties if any.
properties - Properties to consider.
public static java.lang.String[] parsePropertyValues(java.lang.String propValue)
propValue -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||