public class DefaultExpressionResolver extends Object implements ExpressionResolver
Modifier and Type | Field and Description |
---|---|
protected List<String> |
locales |
protected Map<String,LocalizedDummyDefinitions> |
localizedDefinitions |
protected RandomService |
randomService |
Constructor and Description |
---|
DefaultExpressionResolver(List<String> locales,
RandomService randomService,
DefinitionProvider definitionProvider) |
Modifier and Type | Method and Description |
---|---|
String |
resolve(String expression)
Resolves an expression like:
#{name.male_first_name} #{name.last_name} |
protected final RandomService randomService
protected final Map<String,LocalizedDummyDefinitions> localizedDefinitions
public DefaultExpressionResolver(List<String> locales, RandomService randomService, DefinitionProvider definitionProvider)
public String resolve(String expression)
ExpressionResolver
#{name.male_first_name} #{name.last_name}
Definition keys are defined as #{definition.path}
.
Digits are defined simply as #
.
Placeholders which have no definitions will be removed. The method first looks into the locale which was passed as first in the list and then goes to the next ones in order if a key could not be resolved.
resolve
in interface ExpressionResolver
expression
- the expression to evaluateCopyright © 2020. All rights reserved.