public class VariableResolverList extends Object implements VariableResolver
// Create a new variable resolver on a list of values
VariableResolver vr = new VariableResolverList(new String[]{"foo", "bar"});
// Bind the variable resolver to variable type 'sample' (eg. {sample:test})
VariableBinder binder = new VariableBinder();
binder.bindType("sample", vr);
VariableBinder| Constructor and Description |
|---|
VariableResolverList()
Creates a new variable resolver.
|
VariableResolverList(List<String> values)
Creates a new variable resolver from the list of values.
|
VariableResolverList(String[] values)
Creates a new variable resolver from the list of values.
|
public VariableResolverList()
public VariableResolverList(List<String> values)
values - The list of values.public VariableResolverList(String[] values)
values - The list of values.public boolean exists(String value)
true only if the value can be resolved, that is
resolve(value) != null.exists in interface VariableResolvervalue - The value to check for existence.true if the specified value can be resolved;
false otherwise.public Object resolve(String value)
null if the value a value exists, but should return
null, if the value cannot be resolved.
If the implementation does not bind values to objects, this method should return the value if
it can be resolved otherwise, it should return null.resolve in interface VariableResolvervalue - The value to resolve.Copyright © 2014. All rights reserved.