@Override public Map<String, Object> data() { return decoratedContext.data(); }
@Override public Map<String, Object> data() { return inner.data(); }
/** * Render the template * * @param context the routing context * @param templateFileName the template file name to use * @param handler the handler that will be called with a result containing the buffer or a failure. * * @deprecated use {@link #render(RoutingContext, String, String, Handler)} */ @Deprecated default void render(RoutingContext context, String templateFileName, Handler<AsyncResult<Buffer>> handler) { render(new JsonObject(context.data()), templateFileName, handler); }
/** * Render the template * <p> * <b>NOTE</b> if you call method directly (i.e. not using {@link io.vertx.ext.web.handler.TemplateHandler}) make sure * that <i>templateFileName</i> is sanitized via {@link io.vertx.ext.web.impl.Utils#normalizePath(String)} * * @param context the routing context * @param templateDirectory the template directory to use * @param templateFileName the relative template file name to use * @param handler the handler that will be called with a result containing the buffer or a failure. */ @Deprecated default void render(RoutingContext context, String templateDirectory, String templateFileName, Handler<AsyncResult<Buffer>> handler) { render(new JsonObject(context.data()), templateDirectory + templateFileName, handler); }
protected String getValueFromInvocationContext(AccessLogParam<RoutingContext> accessLogParam) { Map<String, Object> data = accessLogParam.getContextData().data(); if (null == data) { return null; } Invocation invocation = (Invocation) data.get(RestConst.REST_INVOCATION_CONTEXT); if (null == invocation) { return null; } return invocation.getContext(varName); }
if (!context.data().containsKey("lang")) { for (LanguageHeader acceptableLocale : context.acceptableLanguages()) { try { context.data().put("lang", acceptableLocale.value()); break; engine.render(new JsonObject(context.data()), templateDirectory + file, res -> { if (res.succeeded()) { context.response().putHeader(HttpHeaders.CONTENT_TYPE, contentType).end(res.result());
/** * @return all the context data as a map */ public Map<String, Object> data() { Map<String, Object> ret = delegate.data(); return ret; }
@Override public Map<String, Object> data() { return inner.data(); }
/** * @return all the context data as a map */ public Map<String, Object> data() { Map<String, Object> ret = delegate.data(); return ret; }
@Override public Map<String, Object> data() { return decoratedContext.data(); }
@Override public Map<String, Object> data() { return rc.data(); }
@Override public Map<String, Object> data() { return delegate.data(); }
/** * Return the current project info. * * @return Project info */ public JsonObject project() { return (JsonObject) rc.data().get("mesh.project"); }
private void insertIntoFilterChain(RoutingContext routingContext) { @SuppressWarnings("unchecked") List<FilterHandler> handleAfterChain = (List<FilterHandler>) routingContext.data().get(FILTER_CHAIN); if (handleAfterChain == null) { handleAfterChain = new ArrayList<>(); routingContext.data().put(FILTER_CHAIN, handleAfterChain); } handleAfterChain.add(0, this); }
/** * Render the template * * @param context the routing context * @param templateFileName the template file name to use * @param handler the handler that will be called with a result containing the buffer or a failure. * * @deprecated use {@link #render(RoutingContext, String, String, Handler)} */ @Deprecated default void render(RoutingContext context, String templateFileName, Handler<AsyncResult<Buffer>> handler) { render(new JsonObject(context.data()), templateFileName, handler); }
protected String getValueFromInvocationContext(AccessLogParam<RoutingContext> accessLogParam) { Map<String, Object> data = accessLogParam.getContextData().data(); if (null == data) { return null; } Invocation invocation = (Invocation) data.get(RestConst.REST_INVOCATION_CONTEXT); if (null == invocation) { return null; } return invocation.getContext(varName); }
private FilterContext buildFilterContext(RoutingContext routingContext) { return new FilterContext(buildRequest(routingContext), buildResponse(routingContext), routingContext.data()); }
static <T> Envelop continuous(final RoutingContext context, final T entity) { final Envelop envelop = Envelop.success(entity); envelop.setHeaders(context.request().headers()); envelop.setUser(context.user()); envelop.setSession(context.session()); envelop.setContext(context.data()); return envelop; }
static <T> Envelop continuous(final RoutingContext context, final T entity) { final Envelop envelop = Envelop.success(entity); envelop.setHeaders(context.request().headers()); envelop.setUser(context.user()); envelop.setSession(context.session()); envelop.setContext(context.data()); return envelop; }