/** * Extract and return injection manager from {@link javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext}. * The method can be used to inject custom types into a {@link javax.ws.rs.ext.WriterInterceptor}. * * @param writerInterceptorContext Writer interceptor context. * * @return injection manager. * * @throws java.lang.IllegalArgumentException when {@code writerInterceptorContext} is not a default * Jersey implementation provided by Jersey as argument in the * {@link javax.ws.rs.ext.WriterInterceptor#aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext)} method. */ public static InjectionManager getInjectionManager(WriterInterceptorContext writerInterceptorContext) { if (!(writerInterceptorContext instanceof InjectionManagerSupplier)) { throw new IllegalArgumentException( LocalizationMessages.ERROR_SERVICE_LOCATOR_PROVIDER_INSTANCE_FEATURE_WRITER_INTERCEPTOR_CONTEXT( writerInterceptorContext.getClass().getName())); } return ((InjectionManagerSupplier) writerInterceptorContext).getInjectionManager(); }
/** * Extract and return injection manager from {@link javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext}. * The method can be used to inject custom types into a {@link javax.ws.rs.ext.WriterInterceptor}. * * @param writerInterceptorContext Writer interceptor context. * * @return injection manager. * * @throws java.lang.IllegalArgumentException when {@code writerInterceptorContext} is not a default * Jersey implementation provided by Jersey as argument in the * {@link javax.ws.rs.ext.WriterInterceptor#aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext)} method. */ public static InjectionManager getInjectionManager(WriterInterceptorContext writerInterceptorContext) { if (!(writerInterceptorContext instanceof InjectionManagerSupplier)) { throw new IllegalArgumentException( LocalizationMessages.ERROR_SERVICE_LOCATOR_PROVIDER_INSTANCE_FEATURE_WRITER_INTERCEPTOR_CONTEXT( writerInterceptorContext.getClass().getName())); } return ((InjectionManagerSupplier) writerInterceptorContext).getInjectionManager(); }
/** * Extract and return service locator from {@link javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext}. * The method can be used to inject custom types into a {@link javax.ws.rs.ext.WriterInterceptor}. * * @param writerInterceptorContext Writer interceptor context. * * @return Service locator. * * @throws java.lang.IllegalArgumentException when {@code writerInterceptorContext} is not a default * Jersey implementation provided by Jersey as argument in the * {@link javax.ws.rs.ext.WriterInterceptor#aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext)} method. */ public static ServiceLocator getServiceLocator(WriterInterceptorContext writerInterceptorContext) { if (!(writerInterceptorContext instanceof ServiceLocatorSupplier)) { throw new IllegalArgumentException( LocalizationMessages.ERROR_SERVICE_LOCATOR_PROVIDER_INSTANCE_FEATURE_WRITER_INTERCEPTOR_CONTEXT( writerInterceptorContext.getClass().getName())); } return ((ServiceLocatorSupplier) writerInterceptorContext).getServiceLocator(); }
/** * Extract and return injection manager from {@link javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext}. * The method can be used to inject custom types into a {@link javax.ws.rs.ext.WriterInterceptor}. * * @param writerInterceptorContext Writer interceptor context. * * @return injection manager. * * @throws java.lang.IllegalArgumentException when {@code writerInterceptorContext} is not a default * Jersey implementation provided by Jersey as argument in the * {@link javax.ws.rs.ext.WriterInterceptor#aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext)} method. */ public static InjectionManager getInjectionManager(WriterInterceptorContext writerInterceptorContext) { if (!(writerInterceptorContext instanceof InjectionManagerSupplier)) { throw new IllegalArgumentException( LocalizationMessages.ERROR_SERVICE_LOCATOR_PROVIDER_INSTANCE_FEATURE_WRITER_INTERCEPTOR_CONTEXT( writerInterceptorContext.getClass().getName())); } return ((InjectionManagerSupplier) writerInterceptorContext).getInjectionManager(); }
/** * Extract and return injection manager from {@link javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext}. * The method can be used to inject custom types into a {@link javax.ws.rs.ext.WriterInterceptor}. * * @param writerInterceptorContext Writer interceptor context. * * @return injection manager. * * @throws java.lang.IllegalArgumentException when {@code writerInterceptorContext} is not a default * Jersey implementation provided by Jersey as argument in the * {@link javax.ws.rs.ext.WriterInterceptor#aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext)} method. */ public static InjectionManager getInjectionManager(WriterInterceptorContext writerInterceptorContext) { if (!(writerInterceptorContext instanceof InjectionManagerSupplier)) { throw new IllegalArgumentException( LocalizationMessages.ERROR_SERVICE_LOCATOR_PROVIDER_INSTANCE_FEATURE_WRITER_INTERCEPTOR_CONTEXT( writerInterceptorContext.getClass().getName())); } return ((InjectionManagerSupplier) writerInterceptorContext).getInjectionManager(); }
/** * Extract and return service locator from {@link javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext}. * The method can be used to inject custom types into a {@link javax.ws.rs.ext.WriterInterceptor}. * * @param writerInterceptorContext Writer interceptor context. * * @return Service locator. * * @throws java.lang.IllegalArgumentException when {@code writerInterceptorContext} is not a default * Jersey implementation provided by Jersey as argument in the * {@link javax.ws.rs.ext.WriterInterceptor#aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext)} method. */ public static ServiceLocator getServiceLocator(WriterInterceptorContext writerInterceptorContext) { if (!(writerInterceptorContext instanceof ServiceLocatorSupplier)) { throw new IllegalArgumentException( LocalizationMessages.ERROR_SERVICE_LOCATOR_PROVIDER_INSTANCE_FEATURE_WRITER_INTERCEPTOR_CONTEXT( writerInterceptorContext.getClass().getName())); } return ((ServiceLocatorSupplier) writerInterceptorContext).getServiceLocator(); }
/** * Extract and return service locator from {@link javax.ws.rs.ext.WriterInterceptorContext writerInterceptorContext}. * The method can be used to inject custom types into a {@link javax.ws.rs.ext.WriterInterceptor}. * * @param writerInterceptorContext Writer interceptor context. * * @return Service locator. * * @throws java.lang.IllegalArgumentException when {@code writerInterceptorContext} is not a default * Jersey implementation provided by Jersey as argument in the * {@link javax.ws.rs.ext.WriterInterceptor#aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext)} method. */ public static ServiceLocator getServiceLocator(WriterInterceptorContext writerInterceptorContext) { if (!(writerInterceptorContext instanceof ServiceLocatorSupplier)) { throw new IllegalArgumentException( LocalizationMessages.ERROR_SERVICE_LOCATOR_PROVIDER_INSTANCE_FEATURE_WRITER_INTERCEPTOR_CONTEXT( writerInterceptorContext.getClass().getName())); } return ((ServiceLocatorSupplier) writerInterceptorContext).getServiceLocator(); }