org.apache.clerezza.triaxrs
Class InjectionUtilities

java.lang.Object
  extended by org.apache.clerezza.triaxrs.InjectionUtilities

public class InjectionUtilities
extends Object

utilities to create parameters for method invocation and inject other stuff

Author:
szalay

Constructor Summary
InjectionUtilities()
           
 
Method Summary
static Object[] createParametersForRequest(Method method, WebRequest request, Map<String,String> pathParams, javax.ws.rs.ext.Providers providers, boolean encodingDisabled)
          this method determines which values have to injected into the method parameters and does it
static Object createPreparedInstance(WebRequest request, Map<String,String> pathParams, javax.ws.rs.ext.Providers providers, Class<?> resourceClass)
          Creates an instance of resourceClass injecting parameters using constructor properties and fields
static void injectFields(WebRequest request, Map<String,String> pathParams, javax.ws.rs.ext.Providers providers, Object instance)
           
static boolean isAnnotated(Annotation[] annotations)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectionUtilities

public InjectionUtilities()
Method Detail

createPreparedInstance

public static Object createPreparedInstance(WebRequest request,
                                            Map<String,String> pathParams,
                                            javax.ws.rs.ext.Providers providers,
                                            Class<?> resourceClass)
                                     throws org.wymiwyg.wrhapi.HandlerException,
                                            UnsupportedFieldType
Creates an instance of resourceClass injecting parameters using constructor properties and fields

Parameters:
request -
resourceClass -
Returns:
an instance of resourceClass
Throws:
org.wymiwyg.wrhapi.HandlerException
UnsupportedFieldType

createParametersForRequest

public static Object[] createParametersForRequest(Method method,
                                                  WebRequest request,
                                                  Map<String,String> pathParams,
                                                  javax.ws.rs.ext.Providers providers,
                                                  boolean encodingDisabled)
                                           throws org.wymiwyg.wrhapi.HandlerException,
                                                  UnsupportedFieldType
this method determines which values have to injected into the method parameters and does it

Parameters:
encodingDisabled - true if the class containing the method is annotaed with @Encoded
providers -
Throws:
org.wymiwyg.wrhapi.HandlerException
UnsupportedFieldType

isAnnotated

public static boolean isAnnotated(Annotation[] annotations)
Parameters:
annotations -
Returns:
true if annotations contains a jax.rs @*Param or @Context Annotation

injectFields

public static void injectFields(WebRequest request,
                                Map<String,String> pathParams,
                                javax.ws.rs.ext.Providers providers,
                                Object instance)
                         throws org.wymiwyg.wrhapi.HandlerException,
                                UnsupportedFieldType
Throws:
org.wymiwyg.wrhapi.HandlerException
UnsupportedFieldType


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.