org.mvel2.integration.impl
Class IndexedVariableResolverFactory

java.lang.Object
  extended by org.mvel2.integration.impl.BaseVariableResolverFactory
      extended by org.mvel2.integration.impl.IndexedVariableResolverFactory
All Implemented Interfaces:
Serializable, VariableResolverFactory

public class IndexedVariableResolverFactory
extends BaseVariableResolverFactory

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mvel2.integration.impl.BaseVariableResolverFactory
indexedVariableNames, indexedVariableResolvers, indexOffset, nextFactory, variableResolvers
 
Constructor Summary
IndexedVariableResolverFactory(String[] varNames, Object[] values)
           
IndexedVariableResolverFactory(String[] varNames, Object[] values, VariableResolverFactory nextFactory)
           
 
Method Summary
protected  VariableResolver addResolver(String name, VariableResolver vr)
           
 void clear()
           
 VariableResolver createIndexedVariable(int index, String name, Object value)
           
 VariableResolver createVariable(String name, Object value)
          Creates a new variable.
 VariableResolver createVariable(String name, Object value, Class<?> type)
          Creates a new variable, and assigns a static type.
 VariableResolver getIndexedVariableResolver(int index)
           
 Set<String> getKnownVariables()
          Return a list of known variables inside the factory.
 VariableResolver getVariableResolver(String name)
          Return a variable resolver for the specified variable name.
 boolean isIndexedFactory()
           
 boolean isResolveable(String name)
          Determines whether or not the variable is resolver in the chain of factories.
 boolean isTarget(String name)
          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, getIndexedVariableNames, getNextFactory, getVariableResolvers, insertFactory, isNextResolveable, setIndexedVariableNames, setIndexedVariableResolver, setNextFactory, setVariableResolvers, variableIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedVariableResolverFactory

public IndexedVariableResolverFactory(String[] varNames,
                                      Object[] values)

IndexedVariableResolverFactory

public IndexedVariableResolverFactory(String[] varNames,
                                      Object[] values,
                                      VariableResolverFactory nextFactory)
Method Detail

createIndexedVariable

public VariableResolver createIndexedVariable(int index,
                                              String name,
                                              Object value)
Specified by:
createIndexedVariable in interface VariableResolverFactory
Overrides:
createIndexedVariable in class BaseVariableResolverFactory

getIndexedVariableResolver

public VariableResolver getIndexedVariableResolver(int index)
Specified by:
getIndexedVariableResolver in interface VariableResolverFactory
Overrides:
getIndexedVariableResolver in class BaseVariableResolverFactory

createVariable

public VariableResolver createVariable(String name,
                                       Object value)
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 created
value - - value of the variable
Returns:
instance of the variable resolver associated with the variable

createVariable

public VariableResolver createVariable(String name,
                                       Object value,
                                       Class<?> type)
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 created
value - - value of the variable
type - - the static type
Returns:
instance of the variable resolver associated with the variable

getVariableResolver

public VariableResolver getVariableResolver(String name)
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 interface VariableResolverFactory
Overrides:
getVariableResolver in class BaseVariableResolverFactory
Parameters:
name - - variable name
Returns:
- instance of the VariableResolver for the specified variable

isResolveable

public boolean isResolveable(String name)
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

protected VariableResolver addResolver(String name,
                                       VariableResolver vr)

isTarget

public boolean isTarget(String name)
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

public Set<String> 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 interface VariableResolverFactory
Overrides:
getKnownVariables in class BaseVariableResolverFactory
Returns:

clear

public void clear()

isIndexedFactory

public boolean isIndexedFactory()
Specified by:
isIndexedFactory in interface VariableResolverFactory
Overrides:
isIndexedFactory in class BaseVariableResolverFactory


Copyright © 2011. All Rights Reserved.