public abstract class AbstractPlaceholderReplacer extends java.lang.Object implements PlaceholderReplacer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SEPARATOR |
Modifier | Constructor and Description |
---|---|
protected |
AbstractPlaceholderReplacer(java.lang.String startDelimiter,
java.lang.String endDelimiter) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
apply(java.lang.String string)
Applies this function to the given argument.
|
protected java.lang.String |
detectAndReplacePlaceholders(java.lang.String input) |
protected java.lang.String |
getDefaultSeparator() |
java.lang.String |
getEndDelimiter() |
java.lang.String |
getStartDelimiter() |
protected abstract java.lang.String |
getValueOfPlaceholder(java.lang.String placeholderName,
java.lang.String defaultValue) |
java.lang.String |
replacePlaceholders(java.lang.String input)
Replaces all placeholders in the given input string and returns the new string
where the placeholders have been replaced.
|
protected IStringPair |
separateNameAndDefaultValue(java.lang.String placeholderName) |
protected StringUtil |
str() |
java.lang.String |
toString() |
public static final java.lang.String DEFAULT_SEPARATOR
protected AbstractPlaceholderReplacer(java.lang.String startDelimiter, java.lang.String endDelimiter)
public java.lang.String apply(java.lang.String string)
IFunction
public java.lang.String replacePlaceholders(java.lang.String input)
PlaceholderReplacer
The placeholder syntax and where the replacement values are coming from is specific to the implementation.
replacePlaceholders
in interface PlaceholderReplacer
input
- The string that contains placeholders (might be null).public java.lang.String getStartDelimiter()
public java.lang.String getEndDelimiter()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String detectAndReplacePlaceholders(java.lang.String input)
protected IStringPair separateNameAndDefaultValue(java.lang.String placeholderName)
protected java.lang.String getDefaultSeparator()
protected abstract java.lang.String getValueOfPlaceholder(java.lang.String placeholderName, java.lang.String defaultValue)
protected StringUtil str()