org.mvel2.integration.impl
Class ClassImportResolverFactory
java.lang.Object
org.mvel2.integration.impl.BaseVariableResolverFactory
org.mvel2.integration.impl.ClassImportResolverFactory
- All Implemented Interfaces:
- java.io.Serializable, VariableResolverFactory
public class ClassImportResolverFactory
- extends BaseVariableResolverFactory
- See Also:
- Serialized Form
Method Summary |
java.lang.Class |
addClass(java.lang.Class clazz)
|
void |
addPackageImport(java.lang.String packageName)
|
void |
clear()
|
VariableResolver |
createVariable(java.lang.String name,
java.lang.Object value)
Creates a new variable. |
VariableResolver |
createVariable(java.lang.String name,
java.lang.Object value,
java.lang.Class type)
Creates a new variable, and assigns a static type. |
java.util.Map<java.lang.String,java.lang.Object> |
getImportedClasses()
|
java.util.Set<java.lang.String> |
getKnownVariables()
Return a list of known variables inside the factory. |
boolean |
isResolveable(java.lang.String name)
Determines whether or not the variable is resolver in the chain of factories. |
boolean |
isTarget(java.lang.String name)
Deterimines whether or not the current VariableResolverFactory is the physical target for the actual
variable. |
void |
setImportedClasses(java.util.Map<java.lang.String,java.lang.Class> imports)
|
Methods inherited from class org.mvel2.integration.impl.BaseVariableResolverFactory |
appendFactory, createIndexedVariable, createIndexedVariable, getIndexedVariableNames, getIndexedVariableResolver, getNextFactory, getVariableResolver, getVariableResolvers, insertFactory, isIndexedFactory, isNextResolveable, setIndexedVariableNames, setIndexedVariableResolver, setNextFactory, setVariableResolvers, variableIndexOf |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassImportResolverFactory
public ClassImportResolverFactory()
ClassImportResolverFactory
public ClassImportResolverFactory(ParserConfiguration ctx,
VariableResolverFactory nextFactory)
createVariable
public VariableResolver createVariable(java.lang.String name,
java.lang.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 createdvalue
- - value of the variable
- Returns:
- instance of the variable resolver associated with the variable
createVariable
public VariableResolver createVariable(java.lang.String name,
java.lang.Object value,
java.lang.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 createdvalue
- - value of the variabletype
- - the static type
- Returns:
- instance of the variable resolver associated with the variable
addClass
public java.lang.Class addClass(java.lang.Class clazz)
isTarget
public boolean isTarget(java.lang.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
isResolveable
public boolean isResolveable(java.lang.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
clear
public void clear()
setImportedClasses
public void setImportedClasses(java.util.Map<java.lang.String,java.lang.Class> imports)
getImportedClasses
public java.util.Map<java.lang.String,java.lang.Object> getImportedClasses()
addPackageImport
public void addPackageImport(java.lang.String packageName)
getKnownVariables
public java.util.Set<java.lang.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:
Copyright © 2010. All Rights Reserved.