Class ContextInjector
- java.lang.Object
-
- org.restlet.ext.jaxrs.internal.wrappers.params.ContextInjector
-
- Direct Known Subclasses:
IntoRrcInjector
@Deprecated public class ContextInjector extends java.lang.ObjectDeprecated.Will be removed in next minor release.Helper class to inject into fields annotated with @Context.- See Also:
IntoRrcInjector
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classContextInjector.BeanSetterDeprecated.private static classContextInjector.EverSameInjectorDeprecated.ContextInjector.Injector, that injects the same object in every resource.private static classContextInjector.ExtendedUriInfoInjectorDeprecated.(package private) static classContextInjector.FieldWrapperDeprecated.private static classContextInjector.GetLastPathSegmentDeprecated.(package private) static interfaceContextInjector.InjectionAimDeprecated.Represents a field or a bean setter, where the runtime injects something in.(package private) static interfaceContextInjector.InjectorDeprecated.private classContextInjector.ParamValueInjectorDeprecated.private static classContextInjector.UriInfoInjectorDeprecated.
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ContextInjector.Injector>injEverSameAimsDeprecated.ThisListcontains the fields in this class which are annotated to inject ever the same object.private static java.util.logging.LoggerloggerDeprecated.
-
Constructor Summary
Constructors Constructor Description ContextInjector(java.lang.Class<?> jaxRsClass, ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers providers, ExtensionBackwardMapping extensionBackwardMapping)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidadd(java.lang.reflect.AccessibleObject fieldOrBeanSetter, ParameterList.AbstractParamGetter iog)Deprecated.(package private) static java.lang.ObjectgetInjectObject(java.lang.Class<?> declaringClass, ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers providers, ExtensionBackwardMapping extensionBackwardMapping)Deprecated.(package private) static ContextInjector.InjectorgetInjector(java.lang.Class<?> declaringClass, ContextInjector.InjectionAim aim, ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers allProviders, ExtensionBackwardMapping extensionBackwardMapping)Deprecated.private voidinit(java.lang.Class<?> jaxRsClass, ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers allProviders, ExtensionBackwardMapping extensionBackwardMapping)Deprecated.initiates the fields to cache the fields that needs injection.voidinjectInto(java.lang.Object jaxRsResObj, boolean allMustBeAvailable)Deprecated.Injects all the supported dependencies into the the given resource object of this class.
-
-
-
Field Detail
-
logger
private static java.util.logging.Logger logger
Deprecated.
-
injEverSameAims
private final java.util.List<ContextInjector.Injector> injEverSameAims
Deprecated.ThisListcontains the fields in this class which are annotated to inject ever the same object.- See Also:
ContextResolver,Providers
-
-
Constructor Detail
-
ContextInjector
public ContextInjector(java.lang.Class<?> jaxRsClass, ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers providers, ExtensionBackwardMapping extensionBackwardMapping) throws IllegalFieldTypeException, IllegalBeanSetterTypeExceptionDeprecated.- Parameters:
jaxRsClass-tlContext-providers- all entity providers.extensionBackwardMapping- the extension backward mapping- Throws:
IllegalBeanSetterTypeException- if one of the bean setters annotated with @Contexthas a type that must not be annotated with @Context.IllegalFieldTypeException- if one of the fields annotated with @Contexthas a type that must not be annotated with @Context.ImplementationException
-
-
Method Detail
-
getInjectObject
static java.lang.Object getInjectObject(java.lang.Class<?> declaringClass, ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers providers, ExtensionBackwardMapping extensionBackwardMapping) throws IllegalTypeException, ImplementationExceptionDeprecated.- Parameters:
declaringClass- the class / interface to injecto into; must not beUriInfotlContext-providers-extensionBackwardMapping-aim-- Returns:
- Throws:
IllegalTypeException- if the given class is not valid to be annotated with @Context.ImplementationException- the declaringClass must not beUriInfo
-
getInjector
static ContextInjector.Injector getInjector(java.lang.Class<?> declaringClass, ContextInjector.InjectionAim aim, ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers allProviders, ExtensionBackwardMapping extensionBackwardMapping) throws IllegalTypeException
Deprecated.- Parameters:
declaringClass-aim-tlContext-allProviders-extensionBackwardMapping-- Returns:
- Throws:
IllegalTypeException- if the given class is not valid to be annotated with @Context.
-
add
protected void add(java.lang.reflect.AccessibleObject fieldOrBeanSetter, ParameterList.AbstractParamGetter iog)Deprecated.
-
init
private void init(java.lang.Class<?> jaxRsClass, ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers allProviders, ExtensionBackwardMapping extensionBackwardMapping) throws IllegalFieldTypeException, IllegalBeanSetterTypeExceptionDeprecated.initiates the fields to cache the fields that needs injection.- Parameters:
tlContext- theThreadLocalizedContextof theJaxRsRestlet.allProviders- all entity providers.extensionBackwardMapping- the extension backward mapping- Throws:
IllegalFieldTypeException- if one of the fields annotated with @Contexthas a type that must not be annotated with @Context.IllegalBeanSetterTypeException- if one of the bean setters annotated with @Contexthas a type that must not be annotated with @Context.
-
injectInto
public void injectInto(java.lang.Object jaxRsResObj, boolean allMustBeAvailable) throws InjectException, java.lang.reflect.InvocationTargetExceptionDeprecated.Injects all the supported dependencies into the the given resource object of this class.- Parameters:
jaxRsResObj-allMustBeAvailable- if true, all information in @Contextannotated objects must be available, especially the ancestor resource info (false for singelton lifecycle)- Throws:
InjectException- if the injection was not possible. SeeThrowable.getCause()for the reason.java.lang.reflect.InvocationTargetException- if a setter throws an exception
-
-