public class ResultNameStrategy extends Object
#hostname#) and with '%' based variables mapped to objectname properties.
Supported '#' based 'functions':
| Function | Description | Sample |
|---|---|---|
#hostname# |
localhost - hostname InetAddress.getHostName() |
|
#reversed_hostname# |
reversed localhost - hostname InetAddress.getHostName() |
|
#escaped_hostname# |
localhost - hostname InetAddress.getHostName() with '.' replaced by '_' |
|
#canonical_hostname# |
localhost - canonical hostname InetAddress.getCanonicalHostName() |
server1.ecommerce.mycompany.com |
#reversed_canonical_hostname# |
reversed localhost - canonical hostname InetAddress.getCanonicalHostName() |
com.mycompany.ecommerce.server1 |
#escaped_canonical_hostname# |
localhost - canonical hostname InetAddress.getCanonicalHostName() with '.' replaced by '_' |
server1_ecommerce_mycompany_com |
#hostaddress# |
localhost - hostaddress InetAddress.getHostAddress() |
|
#escaped_hostname# |
localhost - hostaddress InetAddress.getHostAddress() with '.' replaced by '_' |
| Modifier and Type | Class and Description |
|---|---|
static class |
ResultNameStrategy.StaticEvaluator |
| Constructor and Description |
|---|
ResultNameStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected StringBuilder |
_getResultName(Query query,
ObjectName objectName) |
protected String |
escapeObjectName(ObjectName objectName)
Transforms an ObjectName into a plain String only composed of (a->Z, A-Z, '_').
|
Map<String,Callable<String>> |
getExpressionEvaluators() |
String |
getResultName(Query query,
ObjectName objectName) |
String |
getResultName(Query query,
ObjectName objectName,
String key) |
void |
registerExpressionEvaluator(String expression,
Callable<String> evaluator)
Registers an expression evaluator with a static value.
|
void |
registerExpressionEvaluator(String expression,
String value)
Registers an expression evaluator with a static value.
|
String |
resolveExpression(String expression)
Replace all the '#' based keywords (e.g.
|
protected String |
resolveExpression(String expression,
ObjectName exactObjectName) |
@Nonnull public String getResultName(@Nonnull Query query, @Nonnull ObjectName objectName)
@Nonnull public String getResultName(@Nonnull Query query, @Nonnull ObjectName objectName, @Nullable String key)
@Nonnull protected StringBuilder _getResultName(@Nonnull Query query, @Nonnull ObjectName objectName)
@Nonnull public String resolveExpression(@Nonnull String expression)
#hostname#) by their value.expression - the expression to resolve (e.g. "servers.#hostname#.")"servers.tomcat5")protected String resolveExpression(@Nonnull String expression, @Nonnull ObjectName exactObjectName)
protected String escapeObjectName(@Nonnull ObjectName objectName)
public void registerExpressionEvaluator(String expression, Callable<String> evaluator)
public void registerExpressionEvaluator(String expression, String value)
Copyright © 2013. All Rights Reserved.