class ContextParameterResolver implements ParameterResolver<Context> {

    @Override
    public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception {
        Class<?> parameterClass = parameter.getParameterClass();
        if (parameterClass == HttpHeaders.class) {
            return context.getHttpHeaders();
        } else if (parameterClass == SecurityContext.class) {
            return context.getSecurityContext();
        } else if (parameterClass == Request.class) {
            return context.getRequest();
        } else if (parameterClass == UriInfo.class) {
            return context.getUriInfo();
        } else if (parameterClass == Providers.class) {
            return context.getProviders();
        } else if (parameterClass == Application.class) {
            return context.getApplication();
        } else if (parameterClass == InitialProperties.class) {
            return context.getInitialProperties();
        }
        return EnvironmentContext.getCurrent().get(parameter.getParameterClass());
    }

}