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() |
TODO |
#reversed_hostname# |
reversed localhost - hostname InetAddress.getHostName() |
|
#escaped_hostname# |
localhost - hostname InetAddress.getHostName() with '.' replaced by '_' |
TODO |
#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() |
TODO |
#escaped_hostname# |
localhost - hostaddress InetAddress.getHostAddress() with '.' replaced by '_' |
TODO |
| 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,
QueryAttribute queryAttribute) |
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,
QueryAttribute queryAttribute) |
String |
getResultName(Query query,
ObjectName objectName,
QueryAttribute queryAttribute,
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) |
public String getResultName(Query query, ObjectName objectName, QueryAttribute queryAttribute)
public String getResultName(Query query, ObjectName objectName, QueryAttribute queryAttribute, String key)
protected StringBuilder _getResultName(Query query, ObjectName objectName, QueryAttribute queryAttribute)
public String resolveExpression(String expression)
#hostname#) by their value.expression - the expression to resolve (e.g. "servers.#hostname#.")"servers.tomcat5")protected String resolveExpression(String expression, ObjectName exactObjectName)
protected String escapeObjectName(ObjectName objectName)
public void registerExpressionEvaluator(String expression, Callable<String> evaluator)
public void registerExpressionEvaluator(String expression, String value)
Copyright © 2015. All Rights Reserved.