Java Code Examples for javax.ws.rs.ext.Providers#getContextResolver()
The following examples show how to use
javax.ws.rs.ext.Providers#getContextResolver() .
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: ProvidersUtil.java From camunda-bpm-platform with Apache License 2.0 | 5 votes |
public static <T> T resolveFromContext(Providers providers, Class<T> clazz, MediaType mediaType, Class<?> type) { ContextResolver<T> contextResolver = providers.getContextResolver(clazz, mediaType); if (contextResolver == null) { throw new RestException("No context resolver found for class " + clazz.getName()); } return contextResolver.getContext(type); }
Example 2
Source File: StringDiscoveryResource.java From curator with Apache License 2.0 | 4 votes |
private static DiscoveryContext<String> getContextFromProvider(Providers providers) { ContextResolver<DiscoveryContext> contextResolver = providers.getContextResolver(DiscoveryContext.class, MediaType.WILDCARD_TYPE); //noinspection unchecked return contextResolver.getContext(DiscoveryContext.class); }
Example 3
Source File: ThreadLocalProviders.java From cxf with Apache License 2.0 | 4 votes |
public <T> ContextResolver<T> getContextResolver(Class<T> contextType, MediaType mediaType) { Providers p = getCurrentProviders(); return p != null ? p.getContextResolver(contextType, mediaType) : null; }