本文整理汇总了Java中org.yaml.snakeyaml.tokens.DirectiveToken类的典型用法代码示例。如果您正苦于以下问题:Java DirectiveToken类的具体用法?Java DirectiveToken怎么用?Java DirectiveToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DirectiveToken类属于org.yaml.snakeyaml.tokens包,在下文中一共展示了DirectiveToken类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scanDirective
import org.yaml.snakeyaml.tokens.DirectiveToken; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private Token scanDirective() {
// See the specification for details.
Mark startMark = reader.getMark();
Mark endMark;
reader.forward();
String name = scanDirectiveName(startMark);
List<?> value = null;
if ("YAML".equals(name)) {
value = scanYamlDirectiveValue(startMark);
endMark = reader.getMark();
} else if ("TAG".equals(name)) {
value = scanTagDirectiveValue(startMark);
endMark = reader.getMark();
} else {
endMark = reader.getMark();
int ff = 0;
while (Constant.NULL_OR_LINEBR.hasNo(reader.peek(ff))) {
ff++;
}
if (ff > 0) {
reader.forward(ff);
}
}
scanDirectiveIgnoredLine(startMark);
return new DirectiveToken(name, value, startMark, endMark);
}
示例2: scanDirective
import org.yaml.snakeyaml.tokens.DirectiveToken; //导入依赖的package包/类
private Token scanDirective() {
String chunk1 = data.substring(index, index + DIRECTIVE.length());
char chunk2 = data.charAt(index + DIRECTIVE.length());
if (DIRECTIVE.equals(chunk1) && "\n\0".indexOf(chunk2) != -1) {
index += DIRECTIVE.length();
List<Integer> implicit = new ArrayList<Integer>(2);
implicit.add(new Integer(1));
implicit.add(new Integer(1));
return new DirectiveToken<Integer>("YAML", implicit, mark, mark);
} else {
throw new CanonicalException("invalid directive");
}
}
示例3: scanDirective
import org.yaml.snakeyaml.tokens.DirectiveToken; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private Token scanDirective() {
// See the specification for details.
Mark startMark = reader.getMark();
Mark endMark;
reader.forward();
String name = scanDirectiveName(startMark);
List<?> value = null;
if ("YAML".equals(name)) {
value = scanYamlDirectiveValue(startMark);
endMark = reader.getMark();
} else if ("TAG".equals(name)) {
value = scanTagDirectiveValue(startMark);
endMark = reader.getMark();
} else {
endMark = reader.getMark();
int ff = 0;
while (Constant.NULL_OR_LINEBR.hasNo(reader.peek(ff))) {
ff++;
}
if (ff > 0) {
reader.forward(ff);
}
}
scanDirectiveIgnoredLine(startMark);
return new DirectiveToken(name, value, startMark, endMark);
}