org.trialox.jaxrs
Class InjectionUtilities

java.lang.Object
  extended by org.trialox.jaxrs.InjectionUtilities

public class InjectionUtilities
extends java.lang.Object

utilities to create parameters for method invocation and inject other stuff !TODO: much incomplete

Version:
$Id: $
Author:
szalay

Constructor Summary
InjectionUtilities()
           
 
Method Summary
static java.lang.Object[] createParametersForRequest(java.lang.reflect.Method method, WebRequest request, java.util.Map<java.lang.String,java.lang.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 java.lang.Object createPreparedInstance(WebRequest request, java.util.Map<java.lang.String,java.lang.String> pathParams, javax.ws.rs.ext.Providers providers, java.lang.Class resourceClass)
          Creates an instance of resourceClass injecting parameters using constructor properties and fields
static void injectFields(WebRequest request, java.util.Map<java.lang.String,java.lang.String> pathParams, javax.ws.rs.ext.Providers providers, java.lang.Object instance)
           
static boolean isAnnotated(java.lang.annotation.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 java.lang.Object createPreparedInstance(WebRequest request,
                                                      java.util.Map<java.lang.String,java.lang.String> pathParams,
                                                      javax.ws.rs.ext.Providers providers,
                                                      java.lang.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 java.lang.Object[] createParametersForRequest(java.lang.reflect.Method method,
                                                            WebRequest request,
                                                            java.util.Map<java.lang.String,java.lang.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(java.lang.annotation.Annotation[] annotations)
Parameters:
annotations -
Returns:
true if annotations contains a jax.rs @*Param or @Context Annotation

injectFields

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


Copyright © 2008. All Rights Reserved.