org.glassfish.jersey.internal.inject.InjectionResolver Java Examples
The following examples show how to use
org.glassfish.jersey.internal.inject.InjectionResolver.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Pac4JValueFactoryProvider.java From jax-rs-pac4j with Apache License 2.0 | 6 votes |
@Override protected void configure() { bind(profile).to(ProfileFactoryBuilder.class); bind(optProfile).to(OptionalProfileFactoryBuilder.class); if(manager == null){ bind(DefaultProfileManagerFactoryBuilder.class) .to(ProfileManagerFactoryBuilder.class) ; } else { bind(manager).to(ProfileManagerFactoryBuilder.class); } bind(Pac4JProfileValueFactoryProvider.class).to(ValueParamProvider.class).in(Singleton.class); bind(ProfileInjectionResolver.class) .to(new GenericType<InjectionResolver<Pac4JProfile>>(){}) .in(Singleton.class); bind(ProfileManagerInjectionResolver.class) .to(new GenericType<InjectionResolver<Pac4JProfileManager>>(){}) .in(Singleton.class); }
Example #2
Source File: Pac4JValueFactoryProvider.java From jax-rs-pac4j with Apache License 2.0 | 6 votes |
@Override protected void configure() { bind(profile).to(ProfileFactoryBuilder.class); bind(optProfile).to(OptionalProfileFactoryBuilder.class); if(manager == null){ bind(DefaultProfileManagerFactoryBuilder.class) .to(ProfileManagerFactoryBuilder.class).in(Singleton.class); } else { bind(manager).to(ProfileManagerFactoryBuilder.class); } bindAsContract(Pac4JProfileValueFactoryProvider.class).to(ValueParamProvider.class).in(Singleton.class); bindAsContract(ProfileInjectionResolver.class) .to(new GenericType<InjectionResolver<Pac4JProfile>>(){}) .in(Singleton.class); bindAsContract(ProfileManagerInjectionResolver.class) .to(new GenericType<InjectionResolver<Pac4JProfileManager>>(){}) .in(Singleton.class); }
Example #3
Source File: ProviderRenderUtil.java From dropwizard-guicey with MIT License | 6 votes |
private static String renderParamInjectionResolver(final ParamInjectionResolver instance, final boolean hkManaged, final boolean lazy) { try { final Field field = ParamInjectionResolver.class.getDeclaredField("valueParamProvider"); field.setAccessible(true); final ValueParamProvider param = (ValueParamProvider) field.get(instance); final Class<? extends ParamInjectionResolver> type = instance.getClass(); return String.format("@%-30s %s using %s %s", instance.getAnnotation().getSimpleName(), RenderUtils.renderClassLine(type), param.getClass().getSimpleName(), RenderUtils.markers(collectMarkers(InjectionResolver.class, type, hkManaged, lazy))); } catch (Exception e) { throw new IllegalStateException("Failed to access provider field", e); } }
Example #4
Source File: ProviderRenderUtil.java From dropwizard-guicey with MIT License | 5 votes |
/** * In fuw cases it is possible to get more information using provider instance. So this report * will be a bit more detailed comparing to {@link #render(Class, Class, boolean, boolean)}. * * @param ext extension type (affects render format) * @param instance provider instance * @param isHkManaged true if extension is managed with HK2 * @param isLazy true if extension is annotated with * {@link ru.vyarus.dropwizard.guice.module.installer.install.binding.LazyBinding} * @return rendered provider line */ public static String render(final Class<?> ext, final Object instance, final boolean isHkManaged, final boolean isLazy) { final Class<?> type = instance.getClass(); String res = null; if (ParamInjectionResolver.class.isAssignableFrom(type)) { res = renderParamInjectionResolver((ParamInjectionResolver) instance, isHkManaged, isLazy); } else if (ext.equals(InjectionResolver.class)) { res = renderInjectionResolver((InjectionResolver) instance, isHkManaged, isLazy); } return res == null ? render(ext, type, isHkManaged, isLazy) : res; }
Example #5
Source File: ProviderRenderUtil.java From dropwizard-guicey with MIT License | 5 votes |
private static String renderInjectionResolver(final InjectionResolver instance, final boolean hkManaged, final boolean lazy) { final Class<? extends InjectionResolver> type = instance.getClass(); return String.format(INJECTION_FORMAT, instance.getAnnotation().getSimpleName(), RenderUtils.renderClassLine(type, collectMarkers(InjectionResolver.class, type, hkManaged, lazy))); }
Example #6
Source File: JerseyConfig.java From dropwizard-guicey with MIT License | 2 votes |
/** * Show injection resolvers {@link InjectionResolver}. * * @return config instance for chained calls */ public JerseyConfig showInjectionResolvers() { types.add(InjectionResolver.class); return this; }