本文整理汇总了Java中org.yaml.snakeyaml.tokens.Token.getStartMark方法的典型用法代码示例。如果您正苦于以下问题:Java Token.getStartMark方法的具体用法?Java Token.getStartMark怎么用?Java Token.getStartMark使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.yaml.snakeyaml.tokens.Token
的用法示例。
在下文中一共展示了Token.getStartMark方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: produce
import org.yaml.snakeyaml.tokens.Token; //导入方法依赖的package包/类
public Event produce() {
// Parse an implicit document.
if (!scanner.checkToken(Token.ID.Directive, Token.ID.DocumentStart, Token.ID.StreamEnd)) {
directives = new VersionTagsTuple(null, DEFAULT_TAGS);
Token token = scanner.peekToken();
Mark startMark = token.getStartMark();
Mark endMark = startMark;
Event event = new DocumentStartEvent(startMark, endMark, false, null, null);
// Prepare the next state.
states.push(new ParseDocumentEnd());
state = new ParseBlockNode();
return event;
} else {
Production p = new ParseDocumentStart();
return p.produce();
}
}
示例2: produce
import org.yaml.snakeyaml.tokens.Token; //导入方法依赖的package包/类
@Override
public Event produce() {
// Parse an implicit document.
if (!scanner.checkToken(Token.ID.Directive, Token.ID.DocumentStart, Token.ID.StreamEnd)) {
directives = new VersionTagsTuple(null, DEFAULT_TAGS);
Token token = scanner.peekToken();
Mark startMark = token.getStartMark();
Mark endMark = startMark;
Event event = new DocumentStartEvent(startMark, endMark, false, null, null);
// Prepare the next state.
states.push(new ParseDocumentEnd());
state = new ParseBlockNode();
return event;
} else {
Production p = new ParseDocumentStart();
return p.produce();
}
}
示例3: guessTokenType
import org.yaml.snakeyaml.tokens.Token; //导入方法依赖的package包/类
@NotNull
private Token guessTokenType(Token token, Token nextToken) {
// Maybe it's comment?
if (myText.subSequence(token.getEndMark().getIndex(), nextToken.getStartMark().getIndex()).toString().contains("#"))
return new CommentToken(token.getEndMark(), nextToken.getStartMark());
return new WhitespaceToken(token.getEndMark(), nextToken.getStartMark());
}