Package jfun.yan

Examples of jfun.yan.ParameterBinder


      final Arg a = (Arg)arglist.get(i);
      checkIndex(a, a.getInd());
      indmap.put(new Integer(a.getInd()), a);
    }
    if(args != null || !arglist.isEmpty()){
      component = component.bindArguments(new ParameterBinder(){
        public Creator bind(Signature src, int ind, Class type) {
          if(args!=null && ind < args.length){
            return toComponent(type, args[ind]);
          }
          final Arg a = (Arg)indmap.get(new Integer(ind));
View Full Code Here


    final Object defval = getDefault();
    if(val==null && defval==null){
      return result;
    }
   
    return result.bindArguments(new ParameterBinder(){
      public Creator bind(Signature src, int ind, Class type) {
        if(ind==0){
          Component arg = getVal(type);
          Component def = getDefault(type);
          Component result = arg;
View Full Code Here

      IdChecker idchecker, Dict initial_ctxt){
    MyUtil.assertAttributes(tag, body_attributes);
   
    final String autowire = tag.getAttribute(AUTOWIRE);
    final Location loc = tag.getLocation();
    final ParameterBinder param_wiring = MyUtil.getParamWiring(autowire,
        interpreter.getCustomWiringModes(), loc,
        interpreter.getParameterWiring());
    final PropertyBinder prop_wiring = MyUtil.getPropWiring(autowire,
        interpreter.getCustomWiringModes(), loc,
        interpreter.getPropertyWiring());
View Full Code Here

        }
        public Object run(Dict frame, Runtime runtime){
          Object obj = stmt.run(frame, runtime);
          final Class casttype =
            type==null?null:(Class)type.run(frame, runtime);
          final ParameterBinder autowire =
            wiring==null?null:(ParameterBinder)wiring.run(frame, runtime);
          final SingletonMode singleton =
            singleton_mode==null?null:
              (SingletonMode)singleton_mode.run(frame, runtime);
          final boolean sync = sync_stmt==null?false:
View Full Code Here

  });
  static ParameterBinder getParamWiring(String autowire, AutoWiringMap custom_wirings,
      Location loc, ParameterBinder def){
    if(autowire!=null){
      autowire = autowire.trim().toLowerCase(Locale.US);
      ParameterBinder custom = custom_wirings.getParameterWiringMode(autowire);
      if(custom!=null) return custom;
      if(propmodes.contains(autowire)){
        //this is byname or byqualified name,  we skip.
        return Modes.params_bytype;
      }
View Full Code Here

    return def;
  }
  static ParameterBinder autocast(final ParameterBinder binder,
      final Location loc, final Converter conv){
    if(binder==null) return null;
    return new ParameterBinder(){
      public String toString(){
        return binder.toString();
      }
      public Creator bind(Signature src, int ind, Class type) {
        return cast(type, Components.adapt(binder.bind(src, ind, type)),
View Full Code Here

TOP

Related Classes of jfun.yan.ParameterBinder

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.