Class XelContextProxy

java.lang.Object
org.zkoss.xel.util.XelContextProxy
All Implemented Interfaces:
XelContext

public class XelContextProxy extends Object implements XelContext
A proxy to replace the variable resolver of a given XEL context.
Since:
5.0.0
Author:
tomyeh
  • Constructor Details

    • 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 Details

    • getVariableResolver

      public VariableResolver getVariableResolver()
      Description copied from interface: XelContext
      Returns the variable resolver, or null if not available.
      Specified by:
      getVariableResolver in interface XelContext
    • getFunctionMapper

      public FunctionMapper getFunctionMapper()
      Description copied from interface: XelContext
      Returns the function mapper, or null if not available.
      Specified by:
      getFunctionMapper in interface XelContext
    • getAttribute

      public Object getAttribute(String name)
      Description copied from interface: XelContext
      Returns the value of the specified attribute, or null if not available.
      Specified by:
      getAttribute in interface XelContext
      Parameters:
      name - the name of the attribute to retrieve
      Returns:
      the value
    • setAttribute

      public Object setAttribute(String name, Object value)
      Description copied from interface: XelContext
      Sets the value of the specified attribute
      Specified by:
      setAttribute in interface XelContext
      Parameters:
      name - the name of the attribute to set
      value - the value of the attribute to set
      Returns:
      the previous value
    • hasAttribute

      public boolean hasAttribute(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 of XelContext.getAttribute(java.lang.String).

      Specified by:
      hasAttribute in interface XelContext
      Parameters:
      name - the name of the attribute to test
    • removeAttribute

      public Object removeAttribute(String name)
      Description copied from interface: XelContext
      Removes the attribute.
      Specified by:
      removeAttribute in interface XelContext
      Parameters:
      name - the name of the attribute to remove.
      Returns:
      the previous value associated with the attribute, if any,
    • getAttributes

      public Map<String,Object> getAttributes()
      Description copied from interface: XelContext
      Returns all attributes
      Specified by:
      getAttributes in interface XelContext