Class DefaultTokenReplacer
- java.lang.Object
-
- com.marklogic.client.ext.helper.LoggingObject
-
- com.marklogic.client.ext.tokenreplacer.DefaultTokenReplacer
-
- All Implemented Interfaces:
TokenReplacer
- Direct Known Subclasses:
RoxyTokenReplacer
public class DefaultTokenReplacer extends LoggingObject implements TokenReplacer
Default implementation of TokenReplacer that relies on a list of PropertiesSource implementations for finding tokens to replace in text. The propertyPrefix property allows for adhering to the Roxy convention of referencing properties in module text with "@ml." as a prefix. This class does not look for that prefix; rather, the RoxyTokenReplacer subclass does. This class allows for that prefix to be set to anything.
-
-
Field Summary
-
Fields inherited from class com.marklogic.client.ext.helper.LoggingObject
logger
-
-
Constructor Summary
Constructors Constructor Description DefaultTokenReplacer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertiesSource(PropertiesSource source)java.util.PropertiesgetProperties()java.util.List<PropertiesSource>getPropertiesSources()protected voidinitializeHelper()protected voidinitializeProperties()Initialize the Properties instance based on all the PropertiesSources that have been registered.java.lang.StringreplaceTokens(java.lang.String text)voidsetProperties(java.util.Properties properties)voidsetPropertiesSources(java.util.List<PropertiesSource> propertiesSources)voidsetPropertyPlaceholderHelper(org.springframework.util.PropertyPlaceholderHelper helper)voidsetPropertyPrefix(java.lang.String propertyPrefix)-
Methods inherited from class com.marklogic.client.ext.helper.LoggingObject
format
-
-
-
-
Method Detail
-
addPropertiesSource
public void addPropertiesSource(PropertiesSource source)
-
initializeHelper
protected void initializeHelper()
-
initializeProperties
protected void initializeProperties()
Initialize the Properties instance based on all the PropertiesSources that have been registered.
-
replaceTokens
public java.lang.String replaceTokens(java.lang.String text)
- Specified by:
replaceTokensin interfaceTokenReplacer
-
getPropertiesSources
public java.util.List<PropertiesSource> getPropertiesSources()
-
setPropertiesSources
public void setPropertiesSources(java.util.List<PropertiesSource> propertiesSources)
-
setPropertyPlaceholderHelper
public void setPropertyPlaceholderHelper(org.springframework.util.PropertyPlaceholderHelper helper)
-
getProperties
public java.util.Properties getProperties()
-
setProperties
public void setProperties(java.util.Properties properties)
-
setPropertyPrefix
public void setPropertyPrefix(java.lang.String propertyPrefix)
-
-