public static Object[] createProcessors(Class declaringClass, Method method, ClientConfiguration configuration, MediaType defaultConsumes) { Object[] params = new Object[method.getParameterTypes().length]; for (int i = 0; i < method.getParameterTypes().length; i++) { String parameterName = method.getParameters()[i].getName(); Class<?> type = method.getParameterTypes()[i]; Annotation[] annotations = method.getParameterAnnotations()[i]; Type genericType = method.getGenericParameterTypes()[i]; if (TypeVariable.class.isInstance(genericType) && declaringClass.isInterface() && !declaringClass.equals(method.getDeclaringClass())) { genericType = getTypeArgument((TypeVariable)genericType, declaringClass, method.getDeclaringClass()); } AccessibleObject target = method; params[i] = ProcessorFactory.createProcessor(declaringClass, parameterName, configuration, type, annotations, genericType, target, defaultConsumes, false); } return params; }
public static Object[] createProcessors(Class declaringClass, Method method, ClientConfiguration configuration) { return createProcessors(declaringClass, method, configuration, null); }
static void recursivePush(Type t, Class<?> baseInterface, Stack<Type> superinterfaces) { Class<?> currentClass = null; if (t instanceof Class) { currentClass = (Class) t; } else if (t instanceof ParameterizedType) { currentClass = (Class) ((ParameterizedType) t).getRawType(); } if (baseInterface.isAssignableFrom(currentClass)) { superinterfaces.push(t); for (Type otherType : currentClass.getGenericInterfaces()) { recursivePush(otherType, baseInterface, superinterfaces); } } } }
Type genericType = field.getGenericType(); Object processor = ProcessorFactory.createProcessor( clazz, defaultFormName, configuration, type, annotations, genericType, field, true); if (processor != null) .createProcessor(clazz, defaultFormName, configuration, type, annotations, genericType, method, true); if (processor != null)
org.jboss.resteasy.annotations.jaxrs.QueryParam.class)) != null) processor = new QueryParamProcessor(getParamName(defaultParameterName, queryParam2.value()), genericType, annotations, configuration); org.jboss.resteasy.annotations.jaxrs.HeaderParam.class)) != null) processor = new HeaderParamProcessor(getParamName(defaultParameterName, header2.value()), genericType, annotations, configuration); org.jboss.resteasy.annotations.jaxrs.CookieParam.class)) != null) processor = new CookieParamProcessor(getParamName(defaultParameterName, cookie2.value()), genericType, annotations); org.jboss.resteasy.annotations.jaxrs.PathParam.class)) != null) processor = new PathParamProcessor(getParamName(defaultParameterName, uriParam2.value()), isEncoded, genericType, annotations, configuration); org.jboss.resteasy.annotations.jaxrs.MatrixParam.class)) != null) processor = new MatrixParamProcessor(getParamName(defaultParameterName, matrix2.value()), genericType, annotations, configuration); org.jboss.resteasy.annotations.jaxrs.FormParam.class)) != null) processor = new FormParamProcessor(getParamName(defaultParameterName, formParam2.value()), genericType, annotations, configuration);
Type genericType = field.getGenericType(); Object processor = ProcessorFactory.createProcessor( clazz, configuration, type, annotations, genericType, field, true); if (processor != null) .createProcessor(clazz, configuration, type, annotations, genericType, method, true); if (processor != null)
public static Object[] createProcessors(Class declaringClass, Method method, ClientConfiguration configuration, MediaType defaultConsumes) { Object[] params = new Object[method.getParameterTypes().length]; for (int i = 0; i < method.getParameterTypes().length; i++) { Class<?> type = method.getParameterTypes()[i]; Annotation[] annotations = method.getParameterAnnotations()[i]; Type genericType = method.getGenericParameterTypes()[i]; if (TypeVariable.class.isInstance(genericType) && declaringClass.isInterface() && !declaringClass.equals(method.getDeclaringClass())) { genericType = getTypeArgument((TypeVariable)genericType, declaringClass, method.getDeclaringClass()); } AccessibleObject target = method; params[i] = ProcessorFactory.createProcessor(declaringClass, configuration, type, annotations, genericType, target, defaultConsumes, false); } return params; }
public static Object[] createProcessors(Class declaringClass, Method method, ClientConfiguration configuration) { return createProcessors(declaringClass, method, configuration, null); }
Type currentType; Class<?> currentClass = clazz; recursivePush(currentClass, baseInterface, superinterfaces);
Type genericType = field.getGenericType(); Object processor = ProcessorFactory.createProcessor( clazz, configuration, type, annotations, genericType, field, true); if (processor != null) .createProcessor(clazz, configuration, type, annotations, genericType, method, true); if (processor != null)
public static Object[] createProcessors(Class declaringClass, Method method, ClientConfiguration configuration, MediaType defaultConsumes) { Object[] params = new Object[method.getParameterTypes().length]; for (int i = 0; i < method.getParameterTypes().length; i++) { Class<?> type = method.getParameterTypes()[i]; Annotation[] annotations = method.getParameterAnnotations()[i]; Type genericType = method.getGenericParameterTypes()[i]; if (TypeVariable.class.isInstance(genericType) && declaringClass.isInterface() && !declaringClass.equals(method.getDeclaringClass())) { genericType = getTypeArgument((TypeVariable)genericType, declaringClass, method.getDeclaringClass()); } AccessibleObject target = method; params[i] = ProcessorFactory.createProcessor(declaringClass, configuration, type, annotations, genericType, target, defaultConsumes, false); } return params; }
public static Object[] createProcessors(Class declaringClass, Method method, ClientConfiguration configuration) { return createProcessors(declaringClass, method, configuration, null); }
static void recursivePush(Type t, Class<?> baseInterface, Stack<Type> superinterfaces) { Class<?> currentClass = null; if (t instanceof Class) { currentClass = (Class) t; } else if (t instanceof ParameterizedType) { currentClass = (Class) ((ParameterizedType) t).getRawType(); } if (baseInterface.isAssignableFrom(currentClass)) { superinterfaces.push(t); for (Type otherType : currentClass.getGenericInterfaces()) { recursivePush(otherType, baseInterface, superinterfaces); } } } }
public static Object createProcessor(Class<?> declaring, ClientConfiguration configuration, Class<?> type, Annotation[] annotations, Type genericType, AccessibleObject target, MediaType defaultConsumes, boolean ignoreBody) { Object processor = null; QueryParam query; HeaderParam header; MatrixParam matrix; PathParam uriParam; CookieParam cookie; FormParam formParam; // Form form; boolean isEncoded = FindAnnotation.findAnnotation(annotations, Encoded.class) != null; if ((query = FindAnnotation.findAnnotation(annotations, QueryParam.class)) != null) { processor = new QueryParamProcessor(query.value()); } else if ((header = FindAnnotation.findAnnotation(annotations, HeaderParam.class)) != null) { processor = new HeaderParamProcessor(header.value()); } else if ((cookie = FindAnnotation.findAnnotation(annotations, CookieParam.class)) != null) {
this.processors = ProcessorFactory.createProcessors(declaring, method, invokerConfig, config.getDefaultConsumes()); accepts = MediaTypeHelper.getProduces(declaring, method, config.getDefaultProduces()); entityExtractorFactory = new DefaultEntityExtractorFactory();
static void recursivePush(Type t, Class<?> baseInterface, Stack<Type> superinterfaces) { Class<?> currentClass = null; if (t instanceof Class) { currentClass = (Class) t; } else if (t instanceof ParameterizedType) { currentClass = (Class) ((ParameterizedType) t).getRawType(); } if (baseInterface.isAssignableFrom(currentClass)) { superinterfaces.push(t); for (Type otherType : currentClass.getGenericInterfaces()) { recursivePush(otherType, baseInterface, superinterfaces); } } } }
public static Object createProcessor(Class<?> declaring, ClientConfiguration configuration, Class<?> type, Annotation[] annotations, Type genericType, AccessibleObject target, MediaType defaultConsumes, boolean ignoreBody) { Object processor = null; QueryParam query; HeaderParam header; MatrixParam matrix; PathParam uriParam; CookieParam cookie; FormParam formParam; // Form form; boolean isEncoded = FindAnnotation.findAnnotation(annotations, Encoded.class) != null; if ((query = FindAnnotation.findAnnotation(annotations, QueryParam.class)) != null) { processor = new QueryParamProcessor(query.value()); } else if ((header = FindAnnotation.findAnnotation(annotations, HeaderParam.class)) != null) { processor = new HeaderParamProcessor(header.value()); } else if ((cookie = FindAnnotation.findAnnotation(annotations, CookieParam.class)) != null) {
this.processors = ProcessorFactory.createProcessors(declaring, method, invokerConfig, config.getDefaultConsumes()); accepts = MediaTypeHelper.getProduces(declaring, method, config.getDefaultProduces()); entityExtractorFactory = new DefaultEntityExtractorFactory();
Type currentType; Class<?> currentClass = clazz; recursivePush(currentClass, baseInterface, superinterfaces);
this.processors = ProcessorFactory.createProcessors(declaring, method, invokerConfig, config.getDefaultConsumes()); accepts = MediaTypeHelper.getProduces(declaring, method, config.getDefaultProduces()); entityExtractorFactory = new DefaultEntityExtractorFactory();