Beispiel #1
0
        private IList <System.Reflection.MethodInfo> findMatchingAnnotatedMethods(string parameterName)
        {
            IList <System.Reflection.MethodInfo> result = new List <System.Reflection.MethodInfo>();

            System.Reflection.MethodInfo[] methods = this.GetType().GetMethods();
            for (int i = 0; i < methods.Length; i++)
            {
                System.Reflection.MethodInfo method = methods[i];
                Annotation[] methodAnnotations      = method.GetCustomAttributes(true);

                for (int j = 0; j < methodAnnotations.Length; j++)
                {
                    Annotation annotation = methodAnnotations[j];
                    if (annotation is CamundaQueryParam)
                    {
                        CamundaQueryParam parameterAnnotation = (CamundaQueryParam)annotation;
                        if (parameterAnnotation.value().Equals(parameterName))
                        {
                            result.Add(method);
                        }
                    }
                }
            }
            return(result);
        }
Beispiel #2
0
        private Type findAnnotatedTypeConverter(System.Reflection.MethodInfo method)
        {
            Annotation[] methodAnnotations = method.GetCustomAttributes(true);

            for (int j = 0; j < methodAnnotations.Length; j++)
            {
                Annotation annotation = methodAnnotations[j];
                if (annotation is CamundaQueryParam)
                {
                    CamundaQueryParam parameterAnnotation = (CamundaQueryParam)annotation;
                    return(parameterAnnotation.converter());
                }
            }
            return(null);
        }