public class DefaultPropertyPlaceholderResolver extends Object implements PropertyPlaceholderResolver, AutoCloseable
Nested Class SummaryModifier and TypeClassDescription
classA segment that represents one or more expressions that should be searched for in the environment.
classA segment that represents static text.
static interfaceA segment of placeholder resolution.
Method SummaryModifier and TypeMethodDescriptionSplit a placeholder value into logic segments.
protected <T> TResolves a single expression.
<T> Optional<T>Resolves the optional value of a single placeholder.Resolve the placeholders and return an Optional String if it was possible to resolve them.
<T> TResolves the value of a single placeholder.Resolve the placeholders and return a string if it was possible to resolve them.Resolve the placeholders in the given string.
getPrefixpublic String getPrefix()
resolvePlaceholdersResolve the placeholders and return an Optional String if it was possible to resolve them.
resolveRequiredPlaceholdersResolve the placeholders and return a string if it was possible to resolve them.
resolveRequiredPlaceholdersObjectResolve the placeholders in the given string. This behaves like
PropertyPlaceholderResolver.resolveRequiredPlaceholders(String), except that when the whole input is a placeholder, the value is not converted to String but returned as-is.
resolveRequiredPlaceholderResolves the value of a single placeholder.
- Specified by:
- Type Parameters:
T- The type the value should be converted to
str- The string containing the placeholder
type- The class of the type
- The resolved value
ConfigurationException- If multiple placeholders are found or if the placeholder could not be converted to the requested type
resolveOptionalPlaceholderpublic <T> Optional<T> resolveOptionalPlaceholder
(String str, Class<T> type) throws ConfigurationExceptionResolves the optional value of a single placeholder.
buildSegmentsSplit a placeholder value into logic segments.
str- The placeholder
- The list of segments
resolveExpressionResolves a single expression.
- Type Parameters:
T- The type the expression should be converted to
context- The context of the expression
expression- The expression
type- The class
- The resolved and converted expression
closepublic void close() throws Exception