Package org.zkoss.xel.util
Class XelContextProxy
- java.lang.Object
-
- org.zkoss.xel.util.XelContextProxy
-
- All Implemented Interfaces:
XelContext
public class XelContextProxy extends java.lang.Object implements XelContext
A proxy to replace the variable resolver of a given XEL context.- Since:
- 5.0.0
- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description XelContextProxy(XelContext ctx, FunctionMapper mapper)Replaces the function mapper with the specified one, but the variable resolver not changed.XelContextProxy(XelContext ctx, VariableResolver resolver)Replaces the variable resolver with the specified one, but the function mapper not changed.XelContextProxy(XelContext ctx, VariableResolver resolver, FunctionMapper mapper)Replaces both variable resolver and function mapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetAttribute(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 attributesFunctionMappergetFunctionMapper()Returns the function mapper, or null if not available.VariableResolvergetVariableResolver()Returns the variable resolver, or null if not available.booleanhasAttribute(java.lang.String name)Returns if the attribute is available.java.lang.ObjectremoveAttribute(java.lang.String name)Removes the attribute.java.lang.ObjectsetAttribute(java.lang.String name, java.lang.Object value)Sets the value of the specified attribute
-
-
-
Constructor Detail
-
XelContextProxy
public XelContextProxy(XelContext ctx, VariableResolver resolver)
Replaces the variable resolver with the specified one, but the function mapper not changed.
-
XelContextProxy
public XelContextProxy(XelContext ctx, FunctionMapper mapper)
Replaces the function mapper with the specified one, but the variable resolver not changed.
-
XelContextProxy
public XelContextProxy(XelContext ctx, VariableResolver resolver, FunctionMapper mapper)
Replaces both variable resolver and function mapper.
-
-
Method Detail
-
getVariableResolver
public VariableResolver getVariableResolver()
Description copied from interface:XelContextReturns the variable resolver, or null if not available.- Specified by:
getVariableResolverin interfaceXelContext
-
getFunctionMapper
public FunctionMapper getFunctionMapper()
Description copied from interface:XelContextReturns the function mapper, or null if not available.- Specified by:
getFunctionMapperin interfaceXelContext
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Description copied from interface:XelContextReturns the value of the specified attribute, or null if not available.- Specified by:
getAttributein 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:XelContextSets the value of the specified attribute- Specified by:
setAttributein 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:XelContextReturns if the attribute is available.Notice that
nullis a valid value, so you can tell if an attribute is associated by examining the return value ofXelContext.getAttribute(java.lang.String).- Specified by:
hasAttributein interfaceXelContext- Parameters:
name- the name of the attribute to test
-
removeAttribute
public java.lang.Object removeAttribute(java.lang.String name)
Description copied from interface:XelContextRemoves the attribute.- Specified by:
removeAttributein 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:XelContextReturns all attributes- Specified by:
getAttributesin interfaceXelContext
-
-