Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.AnnotatedAction


    TransitionCriteria actionChain = TransitionCriteriaChain.criteriaChainFor(null);
    assertTrue(actionChain.test(context));
  }

  public void testCriteriaChainForActions() {
    AnnotatedAction[] actions = new AnnotatedAction[] { new AnnotatedAction(new TestAction(true)),
        new AnnotatedAction(new TestAction(false)) };
    TransitionCriteria actionChain = TransitionCriteriaChain.criteriaChainFor(actions);
    assertFalse(actionChain.test(context));
  }
View Full Code Here


  public Object getValue(ELContext elContext, Object base, Object property) {
    if (base instanceof Action) {
      Action action = (Action) base;
      elContext.setPropertyResolved(true);
      AnnotatedAction annotated = new AnnotatedAction(action);
      annotated.setMethod(property.toString());
      return annotated;
    } else {
      return null;
    }
  }
View Full Code Here

    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction());
    context.getRootFlow().setApplicationContext(ac);
    Expression exp = parser.parseExpression("multiAction.setupForm", new FluentParserContext()
        .evaluate(RequestContext.class));
    AnnotatedAction action = (AnnotatedAction) exp.getValue(context);
    assertSame(ac.getBean("multiAction"), action.getTargetAction());
    assertEquals("setupForm", action.getMethod());
  }
View Full Code Here

    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction());
    context.getRootFlow().setApplicationContext(ac);
    Expression exp = parser.parseExpression("multiAction.setupForm", new FluentParserContext()
        .evaluate(RequestContext.class));
    AnnotatedAction action = (AnnotatedAction) exp.getValue(context);
    assertSame(ac.getBean("multiAction"), action.getTargetAction());
    assertEquals("setupForm", action.getMethod());
  }
View Full Code Here

          action = parseSetAction((SetModel) actionModel);
        } else {
          action = null;
        }
        if (action != null) {
          AnnotatedAction annotatedAction = new AnnotatedAction(action);
          annotatedAction.getAttributes().putAll(parseMetaAttributes(actionModel.getAttributes()));
          actions.add(annotatedAction);
        }
      }
      return (Action[]) actions.toArray(new Action[actions.size()]);
    } else {
View Full Code Here

   * Resolves multi action methods.
   */
  private static class ActionPropertyAccessor implements PropertyAccessor {
    public Object getProperty(Map context, Object target, Object name) throws OgnlException {
      Action action = (Action) target;
      AnnotatedAction annotated = new AnnotatedAction(action);
      annotated.setMethod(name.toString());
      return annotated;
    }
View Full Code Here

    Action action = get(index);
    if (action instanceof AnnotatedAction) {
      return (AnnotatedAction) action;
    } else {
      // wrap the action; no annotations will be available
      return new AnnotatedAction(action);
    }
  }
View Full Code Here

    TransitionCriteria actionChain = TransitionCriteriaChain.criteriaChainFor(null);
    assertTrue(actionChain.test(context));
  }

  public void testCriteriaChainForActions() {
    AnnotatedAction[] actions = new AnnotatedAction[] { new AnnotatedAction(new TestAction(true)),
        new AnnotatedAction(new TestAction(false)) };
    TransitionCriteria actionChain = TransitionCriteriaChain.criteriaChainFor(actions);
    assertFalse(actionChain.test(context));
  }
View Full Code Here

    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction());
    context.getRootFlow().setApplicationContext(ac);
    Expression exp = parser.parseExpression("multiAction.setupForm",
        new FluentParserContext().evaluate(RequestContext.class));
    AnnotatedAction action = (AnnotatedAction) exp.getValue(context);
    assertSame(ac.getBean("multiAction"), action.getTargetAction());
    assertEquals("setupForm", action.getMethod());
  }
View Full Code Here

    assertEquals("success", action.execute(context).getId());
    assertEquals(0, context.getAttributes().size());
  }

  public void testExecuteWithChainOfCustomAttributes() throws Exception {
    AnnotatedAction action2 = new AnnotatedAction(action);
    action2.getAttributes().put("attr2", "value");
    action.getAttributes().put("attr", "value");
    action.setTargetAction(new AbstractAction() {
      protected Event doExecute(RequestContext context) throws Exception {
        assertEquals("value", context.getAttributes().getString("attr"));
        assertEquals("value", context.getAttributes().getString("attr2"));
        return success();
      }
    });
    assertEquals("success", action2.execute(context).getId());
    assertEquals(0, context.getAttributes().size());
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.execution.AnnotatedAction

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.