本文整理汇总了Java中org.yaml.snakeyaml.events.Event.ID属性的典型用法代码示例。如果您正苦于以下问题:Java Event.ID属性的具体用法?Java Event.ID怎么用?Java Event.ID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.yaml.snakeyaml.events.Event
的用法示例。
在下文中一共展示了Event.ID属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkEvent
/**
* Check the type of the next event.
*/
public boolean checkEvent(Event.ID choice) {
if (!parsed) {
parse();
}
if (!events.isEmpty()) {
if (events.get(0).is(choice)) {
return true;
}
}
return false;
}
示例2: expect
public Event expect(Event.ID id) {
Event event = next();
if (! event.is(id)) {
throw new IllegalArgumentException("expected " + id + " and was " + event);
}
return event;
}
示例3: checkEvent
/**
* Check the type of the next event.
*/
public boolean checkEvent(Event.ID choice) {
peekEvent();
return currentEvent != null && currentEvent.is(choice);
}
示例4: checkEvent
/**
* Check if the next event is one of the given type.
*
* @param choice
* Event ID.
* @return <code>true</code> if the next event can be assigned to a variable
* of the given type. Returns <code>false</code> if no more events
* are available.
* @throws ParserException
* Thrown in case of malformed input.
*/
public boolean checkEvent(Event.ID choice);