Package org.ocpsoft.rewrite.param

Examples of org.ocpsoft.rewrite.param.ParameterStore


   {
      RequestParameter parameter = RequestParameter.matchesAll("{name}", "{value}");
      MockEvaluationContext context = new MockEvaluationContext();
      ParameterUtils.initialize(context, parameter);

      ParameterStore store = DefaultParameterStore.getInstance(context);
      ((ParameterConfiguration<?>) store.get("value")).constrainedBy(new RegexConstraint("nothing"));
      Assert.assertFalse(parameter.evaluate(rewrite, context));
   }
View Full Code Here


   {
      RequestParameter requestParam = RequestParameter.matchesAll("{name}", "{value}");
      MockEvaluationContext context = new MockEvaluationContext();
      ParameterUtils.initialize(context, requestParam);

      ParameterStore store = DefaultParameterStore.getInstance(context);
      ((ParameterConfiguration<?>) store.get("name")).constrainedBy(new RegexConstraint("nothing"));
      Assert.assertFalse(requestParam.evaluate(rewrite, new MockEvaluationContext()));
   }
View Full Code Here

   {
      RequestParameter requestParam = RequestParameter.matchesAll("baz", "{value}");

      MockEvaluationContext context = new MockEvaluationContext();
      ParameterUtils.initialize(context, requestParam);
      ParameterStore store = DefaultParameterStore.getInstance(context);

      ((ParameterConfiguration<?>) store.get("value")).constrainedBy(new RegexConstraint("(cab|xxx)"));
      Assert.assertFalse(requestParam.evaluate(rewrite, context));
   }
View Full Code Here

                  ParameterizedCallback callback = new ParameterizedCallback() {
                     @Override
                     public void call(Parameterized parameterized)
                     {
                        Set<String> names = parameterized.getRequiredParameterNames();
                        ParameterStore store = ((ParameterizedRule) rule).getParameterStore();

                        if (names != null)
                           for (String name : names) {
                              Parameter<?> parameter = store.get(name, new DefaultParameter(name));
                              if (parameter instanceof ConfigurableParameter<?>)
                                 ((ConfigurableParameter<?>) parameter).bindsTo(Evaluation.property(name));
                           }

                        parameterized.setParameterStore(store);
View Full Code Here

TOP

Related Classes of org.ocpsoft.rewrite.param.ParameterStore

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.