Package org.zkoss.xel

Examples of org.zkoss.xel.VariableResolver


   * @param component
   *            target component
   */
  public static void setSelfContextComponent(Component component) {
    final Execution exec = Executions.getCurrent();
    final VariableResolver vresolver = exec.getVariableResolver();
    ((ExecutionResolver) vresolver).setSelf(component);
  }
View Full Code Here


   *
   * @returns component
   */
  public static Component getSelfContextComponent() {
    final Execution exec = Executions.getCurrent();
    final VariableResolver vresolver = exec.getVariableResolver();
    return (Component) ((ExecutionResolver) vresolver).getSelf();
  }
View Full Code Here

  }
 
  protected Scope getZKScope() {
    final Execution exec = Executions.getCurrent();
    if (exec != null) {
      final VariableResolver vresolver = exec.getVariableResolver();
      if (vresolver != null) {
        return (Scope) vresolver.resolveVariable(getZKScopeName());
      }
    }
    return null;
  }
View Full Code Here

   */
  public Object resolveVariable(String name) {
    Object o = null;
    for (Iterator iterator = _variableResolvers.iterator(); iterator
        .hasNext();) {
      VariableResolver resolver = (VariableResolver) iterator.next();
      o = resolver.resolveVariable(name);
      if (o != null) {
        return o;
      }
    }
    return o;
View Full Code Here

   * @param ctx the context. If null, null will be returned.
   * @since 5.0.0
   */
  public static Object resolveVariable(XelContext ctx, Object base, Object name) {
    if (ctx != null) {
      VariableResolver resolver = ctx.getVariableResolver();
      if (resolver instanceof VariableResolverX)
        return  ((VariableResolverX)resolver).resolveVariable(ctx, base, name);
      else if (resolver != null && base == null && name != null)
        return resolver.resolveVariable(name.toString());
    }
    return null;
  }
View Full Code Here

    if (o != null)
      return o;

    final RequestContext jc = RequestContexts.getCurrent();
    if (jc != null) {
      final VariableResolver parent = jc.getVariableResolver();
      if (parent != null)
        return parent.resolveVariable(name);
    }
    return null;
  }
View Full Code Here

    if (_resolvdefs != null)
      for (Iterator it = _resolvdefs.iterator(); it.hasNext();) {
        final VariableResolverInfo def = (VariableResolverInfo)it.next();
        try {
          VariableResolver resolver =
            def.newVariableResolver(this, page);
          if (resolver != null)
            page.addVariableResolver(resolver);
        } catch (Throwable ex) {
          throw UiException.Aide.wrap(ex);
View Full Code Here

   * Don't reuse it since it has attributes (that shall not be kept
   * after evaluation).
   */
  private XelContext newXelContext(Object ref) {
    final FunctionMapper mapper = getFunctionMapper(ref);
    final VariableResolver resolver = getVariableResolver(ref);
    return new SimpleXelContext(resolver, mapper);
      //Bug 1814838: don't cache the instance
  }
View Full Code Here

   * @param ref the object,either page, component, or null.
   * It is passed to {@link #evaluate}
   */
  public VariableResolver getVariableResolver(Object ref) {
    final Execution exec = Executions.getCurrent();
    VariableResolver resolver = exec.getVariableResolver();
    if (resolver == null) {
      final RequestContext rc = RequestContexts.getCurrent();
      if (rc != null)
        resolver = rc.getVariableResolver();
      if (resolver == null)
View Full Code Here

   * is specified.
   *
   * @since 3.0.0
   */
  public VariableResolver setVariableResolver(VariableResolver resolv) {
    final VariableResolver old =
      _xelc != null ? _xelc.getVariableResolver(): null;
    _xelc = resolv != null ? new SimpleXelContext(resolv, null): null;
    return old;
  }
View Full Code Here

TOP

Related Classes of org.zkoss.xel.VariableResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.