public class VariableResolver extends Object
A set of nested maps that can resolve variables by namespaces. Variables are enclosed with a dollar sign then an opening curly brace, ending with a closing curly brace. Namespaces are delimited with '.' (period).
This class also has special logic to resolve evaluator calls by recognizing the reserved function namespace: dataimporter.functions.xxx
This class caches strings that have already been resolved from the current dih import.
This API is experimental and may change in the future.Modifier and Type | Field and Description |
---|---|
static String |
FUNCTIONS_NAMESPACE |
static String |
FUNCTIONS_NAMESPACE_SHORT |
Constructor and Description |
---|
VariableResolver() |
VariableResolver(Map<String,Object> defaults) |
VariableResolver(Properties defaults) |
Modifier and Type | Method and Description |
---|---|
void |
addNamespace(String name,
Map<String,Object> newMap) |
List<String> |
getVariables(String expr) |
void |
removeNamespace(String name) |
String |
replaceTokens(String template)
Given a String with place holders, replace them with the value tokens.
|
Object |
resolve(String name)
Resolves a given value with a name
|
void |
setEvaluators(Map<String,Evaluator> evaluators) |
public static final String FUNCTIONS_NAMESPACE
public static final String FUNCTIONS_NAMESPACE_SHORT
public VariableResolver()
public VariableResolver(Properties defaults)
public Object resolve(String name)
name
- the String to be resolvedpublic String replaceTokens(String template)
public void removeNamespace(String name)
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.