org.apache.camel.component.properties
Class DefaultPropertiesParser
java.lang.Object
org.apache.camel.component.properties.DefaultPropertiesParser
- All Implemented Interfaces:
- AugmentedPropertyNameAwarePropertiesParser, PropertiesParser
public class DefaultPropertiesParser
- extends Object
- implements AugmentedPropertyNameAwarePropertiesParser
A parser to parse a string which contains property placeholders
Field Summary |
protected org.slf4j.Logger |
log
|
Method Summary |
String |
parseProperty(String key,
String value,
Properties properties)
While parsing the uri using parseUri each
parsed property found invokes this callback. |
String |
parseUri(String text,
Properties properties,
String prefixToken,
String suffixToken)
Parses the string and replaces the property placeholders with values from the given properties. |
String |
parseUri(String text,
Properties properties,
String prefixToken,
String suffixToken,
String propertyPrefix,
String propertySuffix,
boolean fallbackToUnaugmentedProperty)
Parses the string, applying the optional propertyPrefix and
propertySuffix to the parsed property names, and replaces the
property placeholders with values from the given properties. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected final org.slf4j.Logger log
DefaultPropertiesParser
public DefaultPropertiesParser()
parseUri
public String parseUri(String text,
Properties properties,
String prefixToken,
String suffixToken)
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 interface PropertiesParser
- Parameters:
text
- the text to be parsedproperties
- the properties resolved which values should be looked upprefixToken
- the prefix tokensuffixToken
- the suffix token
- Returns:
- the parsed text with replaced placeholders
- Throws:
IllegalArgumentException
- if uri syntax is not valid or a property is not found
parseUri
public String parseUri(String text,
Properties properties,
String prefixToken,
String suffixToken,
String propertyPrefix,
String propertySuffix,
boolean fallbackToUnaugmentedProperty)
throws IllegalArgumentException
- Description copied from interface:
AugmentedPropertyNameAwarePropertiesParser
- Parses the string, applying the optional
propertyPrefix
and
propertySuffix
to the parsed property names, and replaces the
property placeholders with values from the given properties.
- Specified by:
parseUri
in interface AugmentedPropertyNameAwarePropertiesParser
- Parameters:
text
- the text to be parsedproperties
- the properties resolved which values should be looked
upprefixToken
- the prefix tokensuffixToken
- the suffix tokenpropertyPrefix
- the optional property name prefix to augment parsed
property names withpropertySuffix
- the optional property name suffix to augment parsed
property names withfallbackToUnaugmentedProperty
- flag indicating if the originally
parsed property name should by used for resolution if there is
no match to the augmented property name
- Returns:
- the parsed text with replaced placeholders
- Throws:
IllegalArgumentException
- if uri syntax is not valid or a property
is not found
parseProperty
public String parseProperty(String key,
String value,
Properties properties)
- Description copied from interface:
PropertiesParser
- While parsing the uri using
parseUri
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 interface PropertiesParser
- Parameters:
key
- the keyvalue
- the valueproperties
- the properties resolved which values should be looked up
- Returns:
- the value to use
Apache Camel