Package org.mvel2.integration.impl
Class MapVariableResolverFactory
java.lang.Object
org.mvel2.integration.impl.BaseVariableResolverFactory
org.mvel2.integration.impl.MapVariableResolverFactory
- All Implemented Interfaces:
Serializable
,VariableResolverFactory
- Direct Known Subclasses:
DefaultLocalVariableResolverFactory
,InvokationContextFactory
,Proto.ProtoContextFactory
,TypeInjectionResolverFactoryImpl
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionHolds the instance of the variables.Fields inherited from class org.mvel2.integration.impl.BaseVariableResolverFactory
indexedVariableNames, indexedVariableResolvers, indexOffset, nextFactory, variableResolvers
-
Constructor Summary
ConstructorsConstructorDescriptionMapVariableResolverFactory
(Map variables) MapVariableResolverFactory
(Map<String, Object> variables, boolean cachingSafe) MapVariableResolverFactory
(Map<String, Object> variables, VariableResolverFactory nextFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected VariableResolver
addResolver
(String name, VariableResolver vr) void
clear()
createVariable
(String name, Object value) Creates a new variable.createVariable
(String name, Object value, Class<?> type) Creates a new variable, and assigns a static type.Return a list of known variables inside the factory.getVariableResolver
(String name) Return a variable resolver for the specified variable name.boolean
isResolveable
(String name) Determines whether or not the variable is resolver in the chain of factories.boolean
Deterimines whether or not the current VariableResolverFactory is the physical target for the actual variable.Methods inherited from class org.mvel2.integration.impl.BaseVariableResolverFactory
appendFactory, createIndexedVariable, createIndexedVariable, getIndexedVariableNames, getIndexedVariableResolver, getNextFactory, getVariableResolvers, insertFactory, isIndexedFactory, isNextResolveable, setIndexedVariableNames, setIndexedVariableResolver, setNextFactory, setTiltFlag, setVariableResolvers, tiltFlag, variableIndexOf
-
Field Details
-
variables
Holds the instance of the variables.
-
-
Constructor Details
-
MapVariableResolverFactory
public MapVariableResolverFactory() -
MapVariableResolverFactory
-
MapVariableResolverFactory
public MapVariableResolverFactory(Map<String, Object> variables, VariableResolverFactory nextFactory) -
MapVariableResolverFactory
-
-
Method Details
-
createVariable
Description copied from interface:VariableResolverFactory
Creates a new variable. This probably doesn't need to be implemented in most scenarios. This is used for variable assignment.- Parameters:
name
- - name of the variable being createdvalue
- - value of the variable- Returns:
- instance of the variable resolver associated with the variable
-
createVariable
Description copied from interface:VariableResolverFactory
Creates a new variable, and assigns a static type. It is expected the underlying factory and resolver will enforce this.- Parameters:
name
- - name of the variable being createdvalue
- - value of the variabletype
- - the static type- Returns:
- instance of the variable resolver associated with the variable
-
getVariableResolver
Description copied from interface:VariableResolverFactory
Return a variable resolver for the specified variable name. This method is expected to traverse the heirarchy of ResolverFactories.- Specified by:
getVariableResolver
in interfaceVariableResolverFactory
- Overrides:
getVariableResolver
in classBaseVariableResolverFactory
- Parameters:
name
- - variable name- Returns:
- - instance of the VariableResolver for the specified variable
-
isResolveable
Description copied from interface:VariableResolverFactory
Determines whether or not the variable is resolver in the chain of factories.- Parameters:
name
- - variable name- Returns:
- - boolean
-
addResolver
-
isTarget
Description copied from interface:VariableResolverFactory
Deterimines whether or not the current VariableResolverFactory is the physical target for the actual variable.- Parameters:
name
- - variable name- Returns:
- - boolean indicating whether or not factory is the physical target
-
getKnownVariables
Description copied from interface:VariableResolverFactory
Return a list of known variables inside the factory. This method should not recurse into other factories. But rather return only the variables living inside this factory.- Specified by:
getKnownVariables
in interfaceVariableResolverFactory
- Overrides:
getKnownVariables
in classBaseVariableResolverFactory
- Returns:
- variables
-
clear
public void clear()
-