Examples of withArgument()


Examples of jfun.yan.Component.withArgument()

    //try{
      yan.getInstance("target");
      //fail("should have failed with IrresolveableArgumentException");
    //}
    //catch(IrresolveableArgumentException e){}
    yan.registerComponent("list", c1.withArgument(0, Components.useType(int.class)));
    yan.registerComponent("target", Components.useKey("list").seal()
        .withArgument(0, Components.value(12)));
    final java.util.ArrayList result = (ArrayList)yan.getInstance("target");
    final Component array = Components.ctor(String[].class);
   
View Full Code Here

Examples of jfun.yan.Component.withArgument()

        .withArgument(0, Components.value(12)));
    final java.util.ArrayList result = (ArrayList)yan.getInstance("target");
    final Component array = Components.ctor(String[].class);
   
   
    yan.registerComponent("array", array.withArgument(0, Components.useType(int.class)));
    yan.registerComponent("target", Components.useKey("array").seal()
        .withArgument(0, Components.value(12)));
    final String[] arr = (String[])yan.getInstance("target");
    assertEquals(10, arr.length);
    final Component array2 = Components.ctor(int[].class, new Class[]{int.class});
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    yan.registerComponent("target", Components.useKey("array").seal()
        .withArgument(0, Components.value(12)));
    final String[] arr = (String[])yan.getInstance("target");
    assertEquals(10, arr.length);
    final Component array2 = Components.ctor(int[].class, new Class[]{int.class});
    yan.registerComponent("array", array2.withArgument(0, Components.useType(int.class)));
    yan.registerComponent("target", Components.useKey("array").seal()
        .withArgument(0, Components.value(12)));
    final int[] arr2 = (int[])yan.getInstance("target");
    assertEquals(10, arr2.length);
    try{
View Full Code Here

Examples of jfun.yan.Component.withArgument()

        final Component sz2 = c.followedBy(new Binder(){
          public Creator bind(Object l){
            final Component adder =
              Components.value(l).method("add", new Class[]{Object.class});
           
            return adder
              .withArgument(0, Components.useKey("elem1"))
              .seq(adder.withArgument(0, Components.useKey("elem2")));
          }
        }).method(java.util.List.class.getMethod("size", new Class[0]));
        yan.registerValue("elem2", "val2");
View Full Code Here

Examples of jfun.yan.Component.withArgument()

            final Component adder =
              Components.value(l).method("add", new Class[]{Object.class});
           
            return adder
              .withArgument(0, Components.useKey("elem1"))
              .seq(adder.withArgument(0, Components.useKey("elem2")));
          }
        }).method(java.util.List.class.getMethod("size", new Class[0]));
        yan.registerValue("elem2", "val2");
        yan.registerComponent("size", sz2);
        assertEquals(new Integer(2), yan.getInstance("size"));
View Full Code Here

Examples of jfun.yan.Component.withArgument()

   
    final Component acct_request = yan.getComponent("bankaccount_request");
    final HashMap props = new HashMap();
    props.put("balance", new Integer(6666));
    final Integer result = (Integer)yan.instantiateComponent(
        acct_request.withArgument(0, Components.value(props)));
    assertEquals(6666, result.intValue());
   
    final Component acct_request2 = yan.getComponent("bankaccount_request2");
    final HashMap props2 = new HashMap();
    props.put("balance", new Integer(7777));
View Full Code Here

Examples of jfun.yan.Component.withArgument()

   
    final Component acct_request2 = yan.getComponent("bankaccount_request2");
    final HashMap props2 = new HashMap();
    props.put("balance", new Integer(7777));
    final String result2 = (String)yan.instantiateComponent(
        acct_request2.withArgument(0, Components.value(props2)));
    assertEquals("this is my test", result2);
   
   
  }
  public void test2()
View Full Code Here

Examples of org.apache.commons.cli2.builder.DefaultOptionBuilder.withArgument()

      if (defaultValue != null) {
        argBuilder = argBuilder.withDefault(defaultValue);
      }

      optBuilder.withArgument(argBuilder.create());
    }

    return optBuilder.create();
  }
View Full Code Here

Examples of org.apache.commons.cli2.builder.DefaultOptionBuilder.withArgument()

      if (defaultValue != null) {
        argBuilder = argBuilder.withDefault(defaultValue);
      }

      optBuilder.withArgument(argBuilder.create());
    }

    return optBuilder.create();
  }
  //convenience method
View Full Code Here

Examples of org.apache.commons.cli2.builder.DefaultOptionBuilder.withArgument()

      if (defaultValue != null) {
        argBuilder = argBuilder.withDefault(defaultValue);
      }

      optBuilder.withArgument(argBuilder.create());
    }

    return optBuilder.create();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.