gpt4 book ai didi

com.caucho.v5.config.yaml.YamlParser类的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 15:39:31 25 4
gpt4 key购买 nike

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

YamlParser介绍

[英]YamlParser parses an environment.
[中]YamlParser解析环境。

代码示例

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

public static List<Config> parse(Path path)
 throws IOException
{
 try (InputStream is = Files.newInputStream(path)) {
  return new YamlParser(is).parse();
 }
}

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

private String parseIdentifierQuoted(int ch)
 throws IOException
{
 StringBuilder sb = new StringBuilder();
 int quoteChar = ch;
 for(ch = read(); ch > 0 && ch != quoteChar; ch = read()) {
  if (ch == '\r' || ch == '\n') {
   throw error((char) ch);
  }
  sb.append((char) ch);
 }
 return sb.toString();
}

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

private String parseIdentifier(int ch)
 throws IOException
{
 StringBuilder sb = new StringBuilder();
 sb.append((char) ch);
 for (ch = read(); isIdentifierPart(ch); ch = read()) {
  sb.append((char) ch);
 }
 _peek = ch;
 return sb.toString();
}

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

while ((ch = read()) > 0) {
 switch (ch) {
 case ' ':
    && (ch = read()) == '-'
    && (ch = read()) == '-') {
   for (; ch > 0 && ch != '\n'; ch = read()) {
  throw error("depth: " + subDepth + " '" + ch + "'");
  if (isIdentifierStart(ch) || ch == '"' || ch == '\'') {
   if (subDepth <= depth) {
    _peek = ch;
    key = parseIdentifierQuoted(ch);
    key = parseIdentifier(ch);
   ch = readSpaces();
    throw error(L.l("expected ':' at '{0}'", (char) ch));
   parseValues(fullKey);
   subDepth = parse(fullKey, subDepth);
   throw error(ch);

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

private void parseValues(String fullKey)
 throws IOException
 for (int ch = read(); ch > 0; ch = read()) {
  switch (ch) {
  case '\r':
   ch = read();
   if (ch != '\n') {
    _peek = ch;
   if (isIdentifierPart(ch)) {
    StringBuilder sb = new StringBuilder();
    for (ch = read(); ch > 0 && ch != '\r' && ch != '\n'; ch = read()) {
     sb.append((char) ch);
     ch = read();
    throw error((char) ch);

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

private void parseTop()
  throws IOException
{
 while (parse("", -1) >= 0) {
 }
}

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

private int readSpaces()
  throws IOException
 {
  int ch;

  while ((ch = read()) >= 0 && ch == ' ') {
  }

  return ch;
 }
}

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

private List<Config> parse()
 throws IOException
{
 _config = Configs.config();
 parseTop();
 _configList.add(_config.get());
 return _configList;
}

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

private void addConfigFile(String pathName)
{
 String stage;
 if (_args != null) {
  stage = _args.getArg("stage", "main");
 }
 else {
  stage = "main";
 }
 Path path = Vfs.path(pathName);
 try {
  if (Files.isReadable(path)) {
   List<Config> configList = YamlParser.parse(path);
   _configBuilder.add(findStage(configList, stage));
  }
 } catch (Exception e) {
  log.log(Level.FINER, e.toString(), e);
  throw new IllegalStateException(e);
 }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com