本文整理了Java中com.caucho.v5.config.yaml.YamlParser
类的一些代码示例,展示了YamlParser
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlParser
类的具体详情如下:
包路径:com.caucho.v5.config.yaml.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);
}
}
内容来源于网络,如有侵权,请联系作者删除!