private void findContexts(Class<?> cls, Object provider) { findContextFields(cls, provider); findContextSetterMethods(cls, provider); contextsAvailable = contextFields != null && !contextFields.isEmpty() || contextMethods != null && !contextMethods.isEmpty(); }
private void findContexts(Class<?> cls, Object provider, Map<Class<?>, ThreadLocalProxy<?>> constructorProxies) { findContextFields(cls, provider); findContextSetterMethods(cls, provider); if (constructorProxies != null) { Map<Class<?>, Map<Class<?>, ThreadLocalProxy<?>>> proxies = getConstructorProxyMap(true); proxies.put(serviceClass, constructorProxies); constructorProxiesAvailable = true; } contextsAvailable = contextFields != null && !contextFields.isEmpty() || contextMethods != null && !contextMethods.isEmpty() || constructorProxiesAvailable; }
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); }