org.jooby.Request.attributes()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(239)

本文整理了Java中org.jooby.Request.attributes方法的一些代码示例,展示了Request.attributes的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.attributes方法的具体详情如下:
包路径:org.jooby.Request
类名称:Request
方法名:attributes

Request.attributes介绍

[英]A read only version of the current locals.
[中]当前本地文件的只读版本。

代码示例

代码示例来源:origin: jooby-project/jooby

@Override
public Map<String, Object> attributes() {
 return req.attributes();
}

代码示例来源:origin: jooby-project/jooby

@Override
public Set<Entry<String, Object>> propertySet(final Object context) {
 if (context instanceof Request) {
  return ((Request) context).attributes().entrySet();
 }
 return Collections.emptySet();
}

代码示例来源:origin: jooby-project/jooby

protected void handshake(final Request req, final Runnable handler) throws Exception {
 this.injector = req.require(Injector.class);
 this.renderers = ImmutableList.copyOf(injector.getInstance(Renderer.KEY));
 this.produces = req.route().produces();
 this.locals = req.attributes();
 this.lastEventId = req.header("Last-Event-ID");
 this.locale = req.locale();
 handshake(handler);
}

代码示例来源:origin: jooby-project/jooby

@Override
public TemplateModel wrap(final Object obj) throws TemplateModelException {
 if (obj instanceof Config) {
  ConfigObject config = ((Config) obj).root();
  return DefaultMapAdapter.adapt(config.unwrapped(), (ObjectWrapperWithAPISupport) wrapper);
 }
 if (obj instanceof Request) {
  Map<String, Object> req = ((Request) obj).attributes();
  return DefaultMapAdapter.adapt(req, (ObjectWrapperWithAPISupport) wrapper);
 }
 if (obj instanceof Session) {
  Session session = (Session) obj;
  if (session.isDestroyed()) {
   return wrapper.wrap(null);
  }
  Map<String, String> hash = session.attributes();
  return DefaultMapAdapter.adapt(hash, (ObjectWrapperWithAPISupport) wrapper);
 }
 return wrapper.wrap(obj);
}

代码示例来源:origin: org.jooby/jooby

@Override
public Map<String, Object> attributes() {
 return req.attributes();
}

代码示例来源:origin: org.jooby/jooby-hbs

@Override
public Set<Entry<String, Object>> propertySet(final Object context) {
 if (context instanceof Request) {
  return ((Request) context).attributes().entrySet();
 }
 return Collections.emptySet();
}

代码示例来源:origin: org.jooby/jooby

protected void handshake(final Request req, final Runnable handler) throws Exception {
 this.injector = req.require(Injector.class);
 this.renderers = ImmutableList.copyOf(injector.getInstance(Renderer.KEY));
 this.produces = req.route().produces();
 this.locals = req.attributes();
 this.lastEventId = req.header("Last-Event-ID");
 this.locale = req.locale();
 handshake(handler);
}

代码示例来源:origin: org.jooby/jooby-ftl

@Override
public TemplateModel wrap(final Object obj) throws TemplateModelException {
 if (obj instanceof Config) {
  ConfigObject config = ((Config) obj).root();
  return DefaultMapAdapter.adapt(config.unwrapped(), (ObjectWrapperWithAPISupport) wrapper);
 }
 if (obj instanceof Request) {
  Map<String, Object> req = ((Request) obj).attributes();
  return DefaultMapAdapter.adapt(req, (ObjectWrapperWithAPISupport) wrapper);
 }
 if (obj instanceof Session) {
  Session session = (Session) obj;
  if (session.isDestroyed()) {
   return wrapper.wrap(null);
  }
  Map<String, String> hash = session.attributes();
  return DefaultMapAdapter.adapt(hash, (ObjectWrapperWithAPISupport) wrapper);
 }
 return wrapper.wrap(obj);
}

相关文章