Interface PropertiesParser
-
- All Known Implementing Classes:
DefaultPropertiesParser
public interface PropertiesParser
A parser to parse properties for a given input
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
parseProperty(String key, String value, PropertiesLookup properties)
While parsing the uri using parseUri method each parsed property found invokes this callback.String
parseUri(String text, PropertiesLookup properties, boolean fallback, boolean keepUnresolvedOptional, boolean nestedPlaceholder)
Parses the string and replaces the property placeholders with values from the given properties.
-
-
-
Method Detail
-
parseUri
String parseUri(String text, PropertiesLookup properties, boolean fallback, boolean keepUnresolvedOptional, boolean nestedPlaceholder) throws IllegalArgumentException
Parses the string and replaces the property placeholders with values from the given properties.- Parameters:
text
- the text to be parsedproperties
- the properties resolved which values should be looked upfallback
- 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
String parseProperty(String key, String value, PropertiesLookup properties)
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.- Parameters:
key
- the keyvalue
- the valueproperties
- the properties resolved which values should be looked up- Returns:
- the value to use
-
-