net.craftforge.essential.controller.managers
Class InjectionManager

java.lang.Object
  extended by net.craftforge.essential.controller.managers.InjectionManager

public class InjectionManager
extends Object

Since:
21.08.11
Author:
Christian Bick

Constructor Summary
InjectionManager(Consumer consumer, BodyHandler bodyHandler, HeaderHandler headerHandler, ParameterHandler parameterHandler, PropertyHandler propertyHandler)
           
 
Method Summary
 Object getBodyInput(Consumer consumer, Class<?> type)
           
 Object getHeaderInput(Class<?> type, String headerName, String[] defaultValues)
           
 Object getInputForField(Field field)
          Gets the input for a field annotated with @Param from the corresponding parameter.
 List<Object> getInputForMethodParameters(Method method)
          Gets the input for a method's parameters annotated with @Param from the corresponding parameter.
 Object getParameterInput(Consumer consumer, Class<?> type, Type genericType, String parameterName, String[] defaultValues)
           
 Object getPropertyInput(Class<?> type, String propertyName, String[] defaultValues)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectionManager

public InjectionManager(Consumer consumer,
                        BodyHandler bodyHandler,
                        HeaderHandler headerHandler,
                        ParameterHandler parameterHandler,
                        PropertyHandler propertyHandler)
Method Detail

getInputForField

public Object getInputForField(Field field)
                        throws ControllerException
Gets the input for a field annotated with @Param from the corresponding parameter.

Parameters:
field - The field to get the input for
Returns:
The input for the field
Throws:
ControllerException - Failed to estimate a field's input

getInputForMethodParameters

public List<Object> getInputForMethodParameters(Method method)
                                         throws ControllerException
Gets the input for a method's parameters annotated with @Param from the corresponding parameter.

Parameters:
method - The method to get the inputs for its parameters
Returns:
The list of inputs (ordered by parameter order)
Throws:
ControllerException - Failed to estimate a parameter's input

getBodyInput

public Object getBodyInput(Consumer consumer,
                           Class<?> type)
                    throws ControllerException
Throws:
ControllerException

getHeaderInput

public Object getHeaderInput(Class<?> type,
                             String headerName,
                             String[] defaultValues)
                      throws ControllerException
Throws:
ControllerException

getParameterInput

public Object getParameterInput(Consumer consumer,
                                Class<?> type,
                                Type genericType,
                                String parameterName,
                                String[] defaultValues)
                         throws ControllerException
Throws:
ControllerException

getPropertyInput

public Object getPropertyInput(Class<?> type,
                               String propertyName,
                               String[] defaultValues)
                        throws ControllerException
Throws:
ControllerException


Copyright © 2011. All Rights Reserved.