org.osgl.util.Keyword.of()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(92)

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

Keyword.of介绍

[英]Create a Keyword for the given chars
[中]为给定的'chars'创建'Keyword'`

代码示例

代码示例来源:origin: org.actframework/act

@Override
protected Keyword keyword() {
  return Keyword.of(name);
}

代码示例来源:origin: actframework/actframework

public RequestSpec getTemplate(String id) {
  return store.get(Keyword.of(id));
}

代码示例来源:origin: actframework/actframework

private void addAjax() {
    Keyword key = Keyword.of("ajax");
    if (store.containsKey(key)) {
      return;
    }
    RequestSpec spec = new RequestSpec();
    spec.ajax = true;
    spec.json = true;
    store.put(key, spec);
  }
}

代码示例来源:origin: actframework/actframework

static <T extends NamedLogic> T get(Class<? extends NamedLogic> logicType, String name) {
  NamedLogicRegister register = Act.getInstance(NamedLogicRegister.class);
  Map<Keyword, NamedLogic> lookup = register.registry.get(logicType);
  if (null == lookup) {
    return null;
  }
  return (T) lookup.get(Keyword.of(name));
}

代码示例来源:origin: org.actframework/act

private Map<String, Deque<String>> queryParams() {
  if (null == queryParams) {
    queryParams = hse.getQueryParameters();
    if (keywordMatching) {
      queryParamsByKeyword = new HashMap<>();
      for (Map.Entry<String, Deque<String>> entry : queryParams.entrySet()) {
        queryParamsByKeyword.put(Keyword.of(entry.getKey()), entry.getValue());
      }
    }
  }
  return queryParams;
}

代码示例来源:origin: org.actframework/act

private void addAjax() {
    Keyword key = Keyword.of("ajax");
    if (store.containsKey(key)) {
      return;
    }
    RequestSpec spec = new RequestSpec();
    spec.ajax = true;
    spec.json = true;
    store.put(key, spec);
  }
}

代码示例来源:origin: actframework/actframework

public Map<String, String> withoutProperties(String enumTypeName, Locale locale) {
  Map<Keyword, Map<String, String>> map = ensureWithoutProperties(locale);
  return map.get(Keyword.of(enumTypeName));
}

代码示例来源:origin: actframework/actframework

public Map<String, Map<String, Object>> withProperties(String enumTypeName, Locale locale) {
  Map<Keyword, Map<String, Map<String, Object>>> map = ensureWithProperties(locale);
  return map.get(Keyword.of(enumTypeName));
}

代码示例来源:origin: actframework/actframework

private void populateWithoutProperties(Map<Keyword, Map<String, String>> withoutProperties, Locale locale) {
  for (Map.Entry<String, Class<? extends Enum>> entry: eligibleEnums.entrySet()) {
    String key = entry.getKey();
    if (!withoutProperties.containsKey(key)) {
      Map<String, String> map = $.cast(I18n.i18n(locale, entry.getValue()));
      withoutProperties.put(Keyword.of(key), map);
    }
  }
}

代码示例来源:origin: actframework/actframework

private void populateWithProperties(Map<Keyword, Map<String, Map<String, Object>>> withProperties, Locale locale) {
    for (Map.Entry<String, Class<? extends Enum>> entry: eligibleEnums.entrySet()) {
      String key = entry.getKey();
      if (!withProperties.containsKey(key)) {
        Map<String, Map<String, Object>> map = $.cast(I18n.i18n(locale, entry.getValue(), true));
        withProperties.put(Keyword.of(key), map);
      }
    }
  }
}

代码示例来源:origin: org.actframework/act

private void populateWithProperties(Map<Keyword, Map<String, Map<String, Object>>> withProperties, Locale locale) {
    for (Map.Entry<String, Class<? extends Enum>> entry: eligibleEnums.entrySet()) {
      String key = entry.getKey();
      if (!withProperties.containsKey(key)) {
        Map<String, Map<String, Object>> map = $.cast(I18n.i18n(locale, entry.getValue(), true));
        withProperties.put(Keyword.of(key), map);
      }
    }
  }
}

代码示例来源:origin: org.actframework/act-e2e

private void parseOne(String content) {
  Map<String, Object> map = parse(content, NULL_DAO);
  Map<String, Scenario> loaded = $.cast(map);
  for (Map.Entry<String, Scenario> entry : loaded.entrySet()) {
    String key = entry.getKey();
    Scenario scenario = entry.getValue();
    scenario.name = key;
    this.store.put(Keyword.of(key), scenario);
  }
}

代码示例来源:origin: actframework/actframework

@SuppressWarnings("unchecked")
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
  JSONLexer lexer = parser.getLexer();
  if (lexer.token() == JSONToken.LITERAL_STRING) {
    String text = lexer.stringVal();
    lexer.nextToken(JSONToken.COMMA);
    return (T) Keyword.of(text);
  } else {
    throw new UnsupportedOperationException();
  }
}

代码示例来源:origin: actframework/actframework

private String key(String name, BeanSpec spec) {
    if (S.notBlank(name)) {
      return name;
    }
    name = spec.name();
    return Keyword.of(name).httpHeader();
  }
}

代码示例来源:origin: actframework/actframework

private static String fromTokens(List<String> tokens) {
  List<String> filtered = NoisyWordsFilter.filter(tokens);
  String joined = S.join(".", filtered);
  return Keyword.of(joined).httpHeader();
}

代码示例来源:origin: org.actframework/act

@SuppressWarnings("unchecked")
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
  JSONLexer lexer = parser.getLexer();
  if (lexer.token() == JSONToken.LITERAL_STRING) {
    String text = lexer.stringVal();
    lexer.nextToken(JSONToken.COMMA);
    return (T) Keyword.of(text);
  } else {
    throw new UnsupportedOperationException();
  }
}

代码示例来源:origin: org.actframework/act

private ParamKey(String[] seq) {
  this.seq = seq;
  this.size = seq.length;
  if (Act.appConfig().paramBindingKeywordMatching()) {
    keywordSeq = new Keyword[seq.length];
    for (int i = 0; i < seq.length; ++i) {
      keywordSeq[i] = Keyword.of(seq[i]);
    }
  }
  calcHashCode();
}
private ParamKey(String one) {

代码示例来源:origin: org.actframework/act-e2e

@Override
public void register() {
  Keyword keyword = keyword();
  register(keyword);
  for (String alias : aliases()) {
    keyword = Keyword.of(alias);
    register(keyword);
  }
}

代码示例来源:origin: actframework/actframework

protected void register(boolean force) {
  Keyword keyword = keyword();
  NamedLogicRegister register = Act.getInstance(NamedLogicRegister.class);
  register.register(keyword, this, force);
  for (String alias : aliases()) {
    keyword = Keyword.of(alias);
    register.register(keyword, this, force);
  }
}

代码示例来源:origin: org.actframework/act

protected void register(boolean force) {
  Keyword keyword = keyword();
  NamedLogicRegister register = Act.getInstance(NamedLogicRegister.class);
  register.register(keyword, this, force);
  for (String alias : aliases()) {
    keyword = Keyword.of(alias);
    register.register(keyword, this, force);
  }
}

相关文章