private void addContextMethod(Class<?> contextClass, Method m, Object provider) { if (contextMethods == null) { contextMethods = new HashMap<>(); } addToMap(contextMethods, contextClass, m); if (!InjectionUtils.VALUE_CONTEXTS.contains(m.getParameterTypes()[0].getName())) { addToMap(getSetterProxyMap(true), m, getMethodThreadLocalProxy(m, provider)); } }
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(), m, getMethodThreadLocalProxy(m, provider)); } }
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 && (f.getType().isInterface() || f.getType() == Application.class)) { contextFields = addContextField(contextFields, f); checkContextClass(f.getType()); if (!InjectionUtils.VALUE_CONTEXTS.contains(f.getType().getName())) { addToMap(getFieldProxyMap(true), f, getFieldThreadLocalProxy(f, provider)); } } } } findContextFields(cls.getSuperclass(), provider); }
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 || a.annotationType() == Resource.class && AnnotationUtils.isContextClass(f.getType())) { contextFields = addContextField(contextFields, f); if (f.getType() != Application.class) { addToMap(getFieldProxyMap(), f, getFieldThreadLocalProxy(f, provider)); } } } } findContextFields(cls.getSuperclass(), provider); }