예제 #1
0
 private void addContextMethod(Class<?> contextClass, Method m, Object provider) {
   if (contextMethods == null) {
     contextMethods = new HashMap<Class<?>, Map<Class<?>, Method>>();
   }
   addToMap(contextMethods, contextClass, m);
   if (m.getParameterTypes()[0] != Application.class) {
     addToMap(getSetterProxyMap(true), m, getMethodThreadLocalProxy(m, provider));
   }
 }
예제 #2
0
 private void findContextFields(Class<?> cls, Object provider) {
   if (cls == Object.class || cls == null) {
     return;
   }
   for (Field f : cls.getDeclaredFields()) {
     for (Annotation a : f.getAnnotations()) {
       if (a.annotationType() == Context.class) {
         contextFields = addContextField(contextFields, f);
         if (f.getType().isInterface()) {
           checkContextClass(f.getType());
           addToMap(getFieldProxyMap(true), f, getFieldThreadLocalProxy(f, provider));
         }
       }
     }
   }
   findContextFields(cls.getSuperclass(), provider);
 }