Examples of InjectBySetter


Examples of org.nutz.lang.inject.InjectBySetter

   * @return 注入方式。
   */
  public Injecting getInjecting(String fieldName) {
    Method[] sss = this.findSetters(fieldName);
    if (sss.length == 1)
      return new InjectBySetter(sss[0]);
    else
      try {
        Field field = this.getField(fieldName);
        try {
          return new InjectBySetter(this.getSetter(field));
        }
        catch (NoSuchMethodException e) {
          return new InjectByField(field);
        }
      }
View Full Code Here

Examples of org.nutz.lang.inject.InjectBySetter

                  method.getDeclaringClass().getName());
    }
    info.name = name;
    info.fieldType = getter.getGenericReturnType();
    info.ejecting = new EjectByGetter(getter);
    info.injecting = new InjectBySetter(setter);
    return info;
  }
View Full Code Here

Examples of org.nutz.lang.inject.InjectBySetter

                }
                // 正常,开始设值
                info.name = name;
                info.fieldType = getter.getGenericReturnType();
                info.ejecting = new EjectByGetter(getter);
                info.injecting = new InjectBySetter(setter);
            }
        });
        return info;
    }
View Full Code Here

Examples of org.nutz.lang.inject.InjectBySetter

     * @return 注入方式。
     */
    public Injecting getInjecting(String fieldName) {
        Method[] sss = this.findSetters(fieldName);
        if (sss.length == 1)
            return new InjectBySetter(sss[0]);
        else
            try {
                Field field = this.getField(fieldName);
                try {
                    return new InjectBySetter(this.getSetter(field));
                }
                catch (NoSuchMethodException e) {
                    return new InjectByField(field);
                }
            }
View Full Code Here

Examples of org.nutz.lang.inject.InjectBySetter

    public static JsonEntityField eval(String name, Method getter, Method setter) {
        JsonEntityField jef = new JsonEntityField();
        jef.genericType = getter.getGenericReturnType();
        jef.name = name;
        jef.ejecting = new EjectByGetter(getter);
        jef.injecting = new InjectBySetter(setter);
        return jef;
    }
View Full Code Here

Examples of org.nutz.lang.inject.InjectBySetter

                }
                // 正常,开始设值
                info.name = name;
                info.fieldType = getter.getGenericReturnType();
                info.ejecting = new EjectByGetter(getter);
                info.injecting = new InjectBySetter(setter);
            }
        });
        return info;
    }
View Full Code Here

Examples of org.nutz.lang.inject.InjectBySetter

    public static JsonEntityField eval(String name, Method getter, Method setter) {
        JsonEntityField jef = new JsonEntityField();
        jef.genericType = getter.getGenericReturnType();
        jef.name = name;
        jef.ejecting = new EjectByGetter(getter);
        jef.injecting = new InjectBySetter(setter);
        return jef;
    }
View Full Code Here

Examples of org.nutz.lang.inject.InjectBySetter

     * @return 注入方式。
     */
    public Injecting getInjecting(String fieldName) {
        Method[] sss = this.findSetters(fieldName);
        if (sss.length == 1)
            return new InjectBySetter(sss[0]);
        else
            try {
                Field field = this.getField(fieldName);
                try {
                    return new InjectBySetter(this.getSetter(field));
                }
                catch (NoSuchMethodException e) {
                    return new InjectByField(field);
                }
            }
View Full Code Here

Examples of org.nutz.lang.inject.InjectBySetter

      public void invoke(String nm, Method getter, Method setter) {
        mirror = Mirror.me(getter.getGenericReturnType());
        name = nm;
        adaptor = _eval_adaptor(getter.getGenericReturnType());
        adaptor.setEjecting(new EjectByGetter(getter));
        adaptor.setInjecting(new InjectBySetter(setter));
      }
    });
  }
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.