org.cruxframework.crux.core.server.rest.core.dispatch
Class MethodInvoker

java.lang.Object
  extended by org.cruxframework.crux.core.server.rest.core.dispatch.MethodInvoker

public class MethodInvoker
extends Object

Author:
Thiago da Rosa de Bustamante

Nested Class Summary
protected static class MethodInvoker.RestParameterType
           
 
Field Summary
protected  Method method
           
protected  ValueInjector[] params
           
protected  List<RequestPreprocessor> preprocessors
           
protected  Class<?> rootClass
           
 
Constructor Summary
MethodInvoker(Class<?> root, Method method, String httpMethod)
           
 
Method Summary
protected static ValueInjector createParameterExtractor(Class<?> injectTargetClass, Type type, Annotation[] annotations)
           
protected static ValueInjector createParameterExtractorForComplexType(Class<?> injectTargetClass, Type type, Annotation[] annotations)
          The user can define a value object to group parameters that are passed in the same way (query, form, path, cookie, header).
protected static ValueInjector createParameterExtractorForSimpleType(Class<?> injectTargetClass, Type type, Annotation[] annotations)
           
protected static ValueInjector createParameterExtractorForSimpleType(MethodInvoker.RestParameterType restParameterType, Class<?> injectTargetClass, Type type, String paramName, String defaultValue)
           
 ValueInjector[] getParams()
           
protected  void initializePreprocessors()
           
 Object[] injectArguments(HttpRequest input)
           
 Object invoke(HttpRequest request, Object resource)
           
protected  void preprocess(HttpRequest request)
           
protected  void validateParamExtractors(String httpMethod)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

method

protected Method method

rootClass

protected Class<?> rootClass

params

protected ValueInjector[] params

preprocessors

protected List<RequestPreprocessor> preprocessors
Constructor Detail

MethodInvoker

public MethodInvoker(Class<?> root,
                     Method method,
                     String httpMethod)
Method Detail

getParams

public ValueInjector[] getParams()

injectArguments

public Object[] injectArguments(HttpRequest input)

invoke

public Object invoke(HttpRequest request,
                     Object resource)
              throws RestFailure
Throws:
RestFailure

initializePreprocessors

protected void initializePreprocessors()
                                throws RequestProcessorException
Throws:
RequestProcessorException

preprocess

protected void preprocess(HttpRequest request)
                   throws RestFailure
Throws:
RestFailure

createParameterExtractor

protected static ValueInjector createParameterExtractor(Class<?> injectTargetClass,
                                                        Type type,
                                                        Annotation[] annotations)

createParameterExtractorForSimpleType

protected static ValueInjector createParameterExtractorForSimpleType(Class<?> injectTargetClass,
                                                                     Type type,
                                                                     Annotation[] annotations)

createParameterExtractorForSimpleType

protected static ValueInjector createParameterExtractorForSimpleType(MethodInvoker.RestParameterType restParameterType,
                                                                     Class<?> injectTargetClass,
                                                                     Type type,
                                                                     String paramName,
                                                                     String defaultValue)

createParameterExtractorForComplexType

protected static ValueInjector createParameterExtractorForComplexType(Class<?> injectTargetClass,
                                                                      Type type,
                                                                      Annotation[] annotations)
The user can define a value object to group parameters that are passed in the same way (query, form, path, cookie, header).

Parameters:
injectTargetClass -
injectTarget -
type -
genericType -
annotations -
Returns:

validateParamExtractors

protected void validateParamExtractors(String httpMethod)


Copyright © 2015. All rights reserved.