Package org.zkoss.xel.util
Class SimpleXelContext
- java.lang.Object
-
- org.zkoss.xel.util.SimpleXelContext
-
- All Implemented Interfaces:
XelContext
- Direct Known Subclasses:
SimpleBindXelContext
public class SimpleXelContext extends java.lang.Object implements XelContext
A simple implementation ofXelContext
.- Since:
- 3.0.0
- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description SimpleXelContext()
SimpleXelContext(VariableResolver resolver)
SimpleXelContext(VariableResolver resolver, FunctionMapper mapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getAttribute(java.lang.String name)
Returns the value of the specified attribute, or null if not available.java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
Returns all attributesFunctionMapper
getFunctionMapper()
Returns the function mapper, or null if not available.VariableResolver
getVariableResolver()
Returns the variable resolver, or null if not available.boolean
hasAttribute(java.lang.String name)
Returns if the attribute is available.java.lang.Object
removeAttribute(java.lang.String name)
Removes the attribute.java.lang.Object
setAttribute(java.lang.String name, java.lang.Object value)
Sets the value of the specified attributevoid
setFunctionMapper(FunctionMapper mapper)
Sets the function mapper, or null if not available.void
setVariableResolver(VariableResolver resolver)
Sets the variable resolver, or null if not available.
-
-
-
Constructor Detail
-
SimpleXelContext
public SimpleXelContext(VariableResolver resolver, FunctionMapper mapper)
-
SimpleXelContext
public SimpleXelContext(VariableResolver resolver)
-
SimpleXelContext
public SimpleXelContext()
-
-
Method Detail
-
setVariableResolver
public void setVariableResolver(VariableResolver resolver)
Sets the variable resolver, or null if not available.
-
setFunctionMapper
public void setFunctionMapper(FunctionMapper mapper)
Sets the function mapper, or null if not available.
-
getVariableResolver
public VariableResolver getVariableResolver()
Description copied from interface:XelContext
Returns the variable resolver, or null if not available.- Specified by:
getVariableResolver
in interfaceXelContext
-
getFunctionMapper
public FunctionMapper getFunctionMapper()
Description copied from interface:XelContext
Returns the function mapper, or null if not available.- Specified by:
getFunctionMapper
in interfaceXelContext
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Description copied from interface:XelContext
Returns the value of the specified attribute, or null if not available.- Specified by:
getAttribute
in interfaceXelContext
- Parameters:
name
- the name of the attribute to retrieve- Returns:
- the value
-
setAttribute
public java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
Description copied from interface:XelContext
Sets the value of the specified attribute- Specified by:
setAttribute
in interfaceXelContext
- Parameters:
name
- the name of the attribute to setvalue
- the value of the attribute to set- Returns:
- the previous value
-
hasAttribute
public boolean hasAttribute(java.lang.String name)
Description copied from interface:XelContext
Returns if the attribute is available.Notice that
null
is a valid value, so you can tell if an attribute is associated by examining the return value ofXelContext.getAttribute(java.lang.String)
.- Specified by:
hasAttribute
in interfaceXelContext
- Parameters:
name
- the name of the attribute to test
-
removeAttribute
public java.lang.Object removeAttribute(java.lang.String name)
Description copied from interface:XelContext
Removes the attribute.- Specified by:
removeAttribute
in interfaceXelContext
- Parameters:
name
- the name of the attribute to remove.- Returns:
- the previous value associated with the attribute, if any,
-
getAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Description copied from interface:XelContext
Returns all attributes- Specified by:
getAttributes
in interfaceXelContext
-
-