Package io.jmix.flowui.sys
Class ViewControllerReflectionInspector
java.lang.Object
io.jmix.flowui.sys.ViewControllerReflectionInspector
@Component("flowui_ViewControllerReflectionInspector")
public class ViewControllerReflectionInspector
extends Object
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Map<Class,
Collection<MethodHandle>> protected final Function<Class,
MethodHandles.Lookup> protected final com.google.common.cache.Cache<MethodHandle,
MethodHandle> protected final com.google.common.cache.LoadingCache<Class<?>,
ViewControllerReflectionInspector.TargetIntrospectionData> protected final com.google.common.cache.LoadingCache<Class<?>,
ViewControllerReflectionInspector.ViewIntrospectionData> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear underlying reflection caches.protected int
compareSubscribeMethods
(ViewControllerReflectionInspector.AnnotatedMethod<Subscribe> am1, ViewControllerReflectionInspector.AnnotatedMethod<Subscribe> am2) protected <A extends Annotation>
ViewControllerReflectionInspector.AnnotatedMethod<A>createAnnotatedMethod
(Class<A> annotationClass, Method method) getAddListenerMethod
(Class<?> clazz, Class<?> eventType) getAddListenerMethod
(Class<?> clazz, Class<?> eventType, String methodName) protected Map<Class,
MethodHandle> getAddListenerMethodsNotCached
(Class<?> clazz, Method[] uniqueDeclaredMethods) getAllFields
(List<Class<?>> classes) getAnnotatedInjectElementsNotCached
(Class<?> clazz) getAnnotatedInstallMethodsNotCached
(Method[] uniqueDeclaredMethods) getAnnotatedListenerMethodsNotCached
(Class<?> clazz, Method[] uniqueDeclaredMethods) protected <T extends Annotation>
List<ViewControllerReflectionInspector.AnnotatedMethod<T>>getAnnotatedMethodsNotCached
(Class<T> aClass, Method[] uniqueDeclaredMethods, Predicate<Method> filter) getAnnotatedSubscribeMethodsNotCached
(Method[] uniqueDeclaredMethods) getAnnotatedSupplyMethodsNotCached
(Method[] uniqueDeclaredMethods) getComponentEventListenerMethodFactory
(Class<?> ownerClass, ViewControllerReflectionInspector.AnnotatedMethod annotatedMethod, Class<?> eventClass) getConsumerMethodFactory
(Class<?> ownerClass, ViewControllerReflectionInspector.AnnotatedMethod annotatedMethod, Class<?> eventClass) protected Class<?>
getDeclaringClass
(Method method) getInstallTargetMethod
(Class<?> clazz, String methodName) protected Map<String,
MethodHandle> getInstallTargetMethodsNotCached
(Class<?> clazz, Method[] uniqueDeclaredMethods) getOverrideHierarchy
(Method method) getSupplyTargetMethod
(Class<?> clazz, String methodName, Class<?> parameterType) getSupplyTargetMethodsNotCached
(Class<?> clazz, Method[] uniqueDeclaredMethods) getTargetIntrospectionDataNotCached
(Class<?> concreteClass) getValueChangeEventMethodFactory
(Class<?> ownerClass, ViewControllerReflectionInspector.AnnotatedMethod annotatedMethod, Class<?> eventClass) getViewIntrospectionData
(Class<?> clazz) Introspects view class and finds annotated fields and methods for dependency injection.getViewIntrospectionDataNotCached
(Class<?> concreteClass) protected Class
injectionAnnotation
(AnnotatedElement element) protected boolean
isMethodHandleHasName
(MethodHandle methodHandle, String methodName)
-
Field Details
-
viewIntrospectionCache
protected final com.google.common.cache.LoadingCache<Class<?>,ViewControllerReflectionInspector.ViewIntrospectionData> viewIntrospectionCache -
targetIntrospectionCache
protected final com.google.common.cache.LoadingCache<Class<?>,ViewControllerReflectionInspector.TargetIntrospectionData> targetIntrospectionCache -
lambdaMethodsCache
-
argumentTypeToDefaultMethodMap
-
argumentTypesToClashedMethodsMap
-
lambdaLookupProvider
-
-
Constructor Details
-
ViewControllerReflectionInspector
public ViewControllerReflectionInspector()
-
-
Method Details
-
getViewIntrospectionData
public ViewControllerReflectionInspector.ViewIntrospectionData getViewIntrospectionData(Class<?> clazz) Introspects view class and finds annotated fields and methods for dependency injection.- Parameters:
clazz
- view class- Returns:
- view data
-
getAddListenerMethod
-
getAddListenerMethod
@Nullable public MethodHandle getAddListenerMethod(Class<?> clazz, Class<?> eventType, String methodName) -
getInstallTargetMethod
-
getSupplyTargetMethod
@Nullable public MethodHandle getSupplyTargetMethod(Class<?> clazz, String methodName, Class<?> parameterType) -
getConsumerMethodFactory
public MethodHandle getConsumerMethodFactory(Class<?> ownerClass, ViewControllerReflectionInspector.AnnotatedMethod annotatedMethod, Class<?> eventClass) -
getValueChangeEventMethodFactory
public MethodHandle getValueChangeEventMethodFactory(Class<?> ownerClass, ViewControllerReflectionInspector.AnnotatedMethod annotatedMethod, Class<?> eventClass) -
getComponentEventListenerMethodFactory
public MethodHandle getComponentEventListenerMethodFactory(Class<?> ownerClass, ViewControllerReflectionInspector.AnnotatedMethod annotatedMethod, Class<?> eventClass) -
clearCache
public void clearCache()Clear underlying reflection caches. -
getViewIntrospectionDataNotCached
protected ViewControllerReflectionInspector.ViewIntrospectionData getViewIntrospectionDataNotCached(Class<?> concreteClass) -
getTargetIntrospectionDataNotCached
protected ViewControllerReflectionInspector.TargetIntrospectionData getTargetIntrospectionDataNotCached(Class<?> concreteClass) -
getAnnotatedInjectElementsNotCached
protected List<ViewControllerReflectionInspector.InjectElement> getAnnotatedInjectElementsNotCached(Class<?> clazz) -
getAllFields
-
injectionAnnotation
-
getAnnotatedListenerMethodsNotCached
-
getAnnotatedSupplyMethodsNotCached
protected List<ViewControllerReflectionInspector.AnnotatedMethod<Supply>> getAnnotatedSupplyMethodsNotCached(Method[] uniqueDeclaredMethods) -
getAnnotatedInstallMethodsNotCached
protected List<ViewControllerReflectionInspector.AnnotatedMethod<Install>> getAnnotatedInstallMethodsNotCached(Method[] uniqueDeclaredMethods) -
getAnnotatedSubscribeMethodsNotCached
protected List<ViewControllerReflectionInspector.AnnotatedMethod<Subscribe>> getAnnotatedSubscribeMethodsNotCached(Method[] uniqueDeclaredMethods) -
getAnnotatedMethodsNotCached
protected <T extends Annotation> List<ViewControllerReflectionInspector.AnnotatedMethod<T>> getAnnotatedMethodsNotCached(Class<T> aClass, Method[] uniqueDeclaredMethods, Predicate<Method> filter) -
createAnnotatedMethod
@Nullable protected <A extends Annotation> ViewControllerReflectionInspector.AnnotatedMethod<A> createAnnotatedMethod(Class<A> annotationClass, Method method) -
compareSubscribeMethods
protected int compareSubscribeMethods(ViewControllerReflectionInspector.AnnotatedMethod<Subscribe> am1, ViewControllerReflectionInspector.AnnotatedMethod<Subscribe> am2) -
getDeclaringClass
-
getOverrideHierarchy
-
getAddListenerMethodsNotCached
protected Map<Class,MethodHandle> getAddListenerMethodsNotCached(Class<?> clazz, Method[] uniqueDeclaredMethods) -
getInstallTargetMethodsNotCached
protected Map<String,MethodHandle> getInstallTargetMethodsNotCached(Class<?> clazz, Method[] uniqueDeclaredMethods) -
getSupplyTargetMethodsNotCached
protected Map<ViewControllerReflectionInspector.MethodSignature,MethodHandle> getSupplyTargetMethodsNotCached(Class<?> clazz, Method[] uniqueDeclaredMethods) -
isMethodHandleHasName
-