Class DefaultPropertiesParser
java.lang.Object
org.apache.camel.component.properties.DefaultPropertiesParser
- All Implemented Interfaces:
PropertiesParser
A parser to parse a string which contains property placeholders.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionparseProperty
(String key, String value, PropertiesLookup properties) While parsing the uri using parseUri method each parsed property found invokes this callback.parseUri
(String text, PropertiesLookup properties, boolean defaultFallbackEnabled, boolean keepUnresolvedOptional, boolean nestedPlaceholder) Parses the string and replaces the property placeholders with values from the given properties.void
setPropertiesComponent
(PropertiesComponent propertiesComponent)
-
Field Details
-
log
protected final org.slf4j.Logger log
-
-
Constructor Details
-
DefaultPropertiesParser
public DefaultPropertiesParser() -
DefaultPropertiesParser
-
-
Method Details
-
getPropertiesComponent
-
setPropertiesComponent
-
parseUri
public String parseUri(String text, PropertiesLookup properties, boolean defaultFallbackEnabled, boolean keepUnresolvedOptional, boolean nestedPlaceholder) throws IllegalArgumentException Description copied from interface:PropertiesParser
Parses the string and replaces the property placeholders with values from the given properties.- Specified by:
parseUri
in interfacePropertiesParser
- Parameters:
text
- the text to be parsedproperties
- the properties resolved which values should be looked updefaultFallbackEnabled
- whether to support using fallback values if a property cannot be foundkeepUnresolvedOptional
- whether to keep placeholders that are optional and was unresolvednestedPlaceholder
- whether to support nested property placeholders. A nested placeholder, means that a placeholder, has also a placeholder, that should be resolved (recursively).- Returns:
- the parsed text with replaced placeholders
- Throws:
IllegalArgumentException
- if uri syntax is not valid or a property is not found
-
parseProperty
Description copied from interface:PropertiesParser
While parsing the uri using parseUri method each parsed property found invokes this callback. This strategy method allows you to hook into the parsing and do custom lookup and return the actual value to use.- Specified by:
parseProperty
in interfacePropertiesParser
- Parameters:
key
- the keyvalue
- the valueproperties
- the properties resolved which values should be looked up- Returns:
- the value to use
-