public interface VariableContext extends VariableResolver
VariableResolver. It extends the resolver by allowing registration of delegate resolvers and adding a convenience method to return converted variable values.
|Modifier and Type||Method and Description|
Adds a variable resolver to this variable context.
Returns the value of the variable given by name and converts it into the target type
Removes the specified variable resolver if it exists and does nothing otherwise.
void addVariableResolver(VariableResolver resolver)
resolver- the resolver to add
void removeVariableResolver(VariableResolver resolver)
resolver- the resolver to remove
<V> V getValue(String name, ValueConverter<V> converter) throws IllegalArgumentException
<V>using the given converter. Returns null if no such variable exists. An exception is thrown if the conversion fails, or which is indicated by a null value returned by the converter for a non-null input value.
V- the target value type
name- the variable name
converter- a converter suitable to convert values into the target type
IllegalArgumentException- if the value conversion fails, that is, if the converter returns null for the non-null input value
Copyright © 2022. All rights reserved.