Package org.zkoss.zk.xel

Examples of org.zkoss.zk.xel.Evaluator


      if (expectedType == Object.class || expectedType == String.class)
        return expr;
      return Classes.coerce(expectedType, expr);
    }

    final Evaluator eval = getEvaluator(page, null);
    final Expression expression = eval.parseExpression(expr, expectedType);
    return self instanceof Page ?
      eval.evaluate((Page)self, expression):
      eval.evaluate((Component)self, expression);
  }
View Full Code Here


    if (_apply == null && defapply == null)
      return null;

    try {
      List composers = new LinkedList();
      Evaluator eval = getEvaluator();
      toComposers(composers, defapply, eval, page, comp);
      toComposers(composers, _apply, eval, page, comp);

      return MultiComposer.getComposer(page,
        (Composer[])composers.toArray(new Composer[composers.size()]));
View Full Code Here

   *
   * @param comp the parent component (it cannot be null)
   */
  public void apply(Component comp) {
    if (_vars != null && isEffective(comp)) {
      final Evaluator eval = _evalr.getEvaluator();
      for (Iterator it = _vars.entrySet().iterator(); it.hasNext();) {
        final Map.Entry me = (Map.Entry)it.next();
        final String name = (String)me.getKey();
        final Object value = me.getValue();
        comp.setVariable(
View Full Code Here

  /** Applies the variable element against the page.
   * It is called if the element doesn't belong to any component.
   */
  public void apply(Page page) {
    if (_vars != null && isEffective(page)) {
      final Evaluator eval = _evalr.getEvaluator();
      for (Iterator it = _vars.entrySet().iterator(); it.hasNext();) {
        final Map.Entry me = (Map.Entry)it.next();
        final String name = (String)me.getKey();
        final Object value = me.getValue();
        page.setVariable(
View Full Code Here

   *
   * <p>Note: if URI contains EL expressions and is evaluated to an empty
   * string, this method returns null to indicate no need to forward.
   */
  public String resolveURI(PageDefinition pgdef, Page page) {
    final Evaluator eval = pgdef.getEvaluator();
    if (_cond == null || _cond.isEffective(eval, page)) {
      final String uri = (String)_uri.getValue(eval, page);
      if (uri != null && uri.length() != 0)
        return uri;
    }
View Full Code Here

  /** Applies the custom attributes.
   * <p>Note: this method does nothing if {@link #isEffective} returns false.
   */
  public void apply(Component comp) {
    if (_attrs != null && isEffective(comp)) {
      final Evaluator eval = _evalr.getEvaluator();
      for (Iterator it = _attrs.entrySet().iterator(); it.hasNext();) {
        final Map.Entry me = (Map.Entry)it.next();
        final String name = (String)me.getKey();
        final Object value = me.getValue();
        comp.setAttribute(
View Full Code Here

  /** Applies the custom attributes.
   * <p>Note: this method does nothing if {@link #isEffective} returns false.
   */
  public void apply(Page page) {
    if (_attrs != null && isEffective(page)) {
      final Evaluator eval = _evalr.getEvaluator();
      for (Iterator it = _attrs.entrySet().iterator(); it.hasNext();) {
        final Map.Entry me = (Map.Entry)it.next();
        final String name = (String)me.getKey();
        final Object value = me.getValue();
        page.setAttribute(name,
View Full Code Here

   */
  public String getRootAttributes(Page page) {
    if (_rootAttrs == null || _rootAttrs.isEmpty())
      return "";

    final Evaluator eval = getEvaluator();
    final StringBuffer sb = new StringBuffer(256);
    for (Iterator it = _rootAttrs.entrySet().iterator(); it.hasNext();) {
      final Map.Entry me = (Map.Entry)it.next();
      final String val = (String)
        ((ExValue)me.getValue()).getValue(eval, page);
View Full Code Here

TOP

Related Classes of org.zkoss.zk.xel.Evaluator

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.