|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.csdn.common.property.PropertyPlaceholder
public class PropertyPlaceholder
BlogInfo: william Date: 11-9-2 Time: 上午11:32
| Nested Class Summary | |
|---|---|
static interface |
PropertyPlaceholder.PlaceholderResolver
Strategy interface used to resolve replacement values for placeholders contained in Strings. |
| Constructor Summary | |
|---|---|
PropertyPlaceholder(String placeholderPrefix,
String placeholderSuffix)
Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix. |
|
PropertyPlaceholder(String placeholderPrefix,
String placeholderSuffix,
boolean ignoreUnresolvablePlaceholders)
Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix. |
|
| Method Summary | |
|---|---|
protected String |
parseStringValue(String strVal,
PropertyPlaceholder.PlaceholderResolver placeholderResolver,
Set<String> visitedPlaceholders)
|
String |
replacePlaceholders(String value,
Properties properties)
Replaces all placeholders of format ${name} with the corresponding property from the supplied Properties. |
String |
replacePlaceholders(String value,
PropertyPlaceholder.PlaceholderResolver placeholderResolver)
Replaces all placeholders of format ${name} with the value returned from the supplied PropertyPlaceholder.PlaceholderResolver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertyPlaceholder(String placeholderPrefix,
String placeholderSuffix)
PropertyPlaceholderHelper that uses the supplied prefix and suffix. Unresolvable
placeholders are ignored.
placeholderPrefix - the prefix that denotes the start of a placeholder.placeholderSuffix - the suffix that denotes the end of a placeholder.
public PropertyPlaceholder(String placeholderPrefix,
String placeholderSuffix,
boolean ignoreUnresolvablePlaceholders)
PropertyPlaceholderHelper that uses the supplied prefix and suffix.
placeholderPrefix - the prefix that denotes the start of a placeholder.placeholderSuffix - the suffix that denotes the end of a placeholder.ignoreUnresolvablePlaceholders - indicates whether unresolvable placeholders should be ignored
(true) or cause an exception (false).| Method Detail |
|---|
public String replacePlaceholders(String value,
Properties properties)
${name} with the corresponding property from the supplied Properties.
value - the value containing the placeholders to be replaced.properties - the Properties to use for replacement.
public String replacePlaceholders(String value,
PropertyPlaceholder.PlaceholderResolver placeholderResolver)
${name} with the value returned from the supplied PropertyPlaceholder.PlaceholderResolver.
value - the value containing the placeholders to be replaced.placeholderResolver - the PlaceholderResolver to use for replacement.
protected String parseStringValue(String strVal,
PropertyPlaceholder.PlaceholderResolver placeholderResolver,
Set<String> visitedPlaceholders)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||