本文整理了Java中org.yaml.snakeyaml.events.Event.is()
方法的一些代码示例,展示了Event.is()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.is()
方法的具体详情如下:
包路径:org.yaml.snakeyaml.events.Event
类名称:Event
方法名:is
暂无
代码示例来源:origin: redisson/redisson
/**
* Check the type of the next event.
*/
public boolean checkEvent(Event.ID choice) {
peekEvent();
return currentEvent != null && currentEvent.is(choice);
}
代码示例来源:origin: redisson/redisson
if (!evt.is(Event.ID.Scalar)) {
if (evt.is(Event.ID.MappingEnd)) {
if (!_parsingContext.inObject()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker('}', ']');
if (evt.is(Event.ID.Scalar)) {
JsonToken t = _decodeScalar((ScalarEvent) evt);
_currToken = t;
if (evt.is(Event.ID.MappingStart)) {
Mark m = evt.getStartMark();
MappingStartEvent map = (MappingStartEvent) evt;
if (evt.is(Event.ID.MappingEnd)) { // actually error; can not have map-end here
_reportError("Not expecting END_OBJECT but a value");
if (evt.is(Event.ID.SequenceStart)) {
Mark m = evt.getStartMark();
_currentAnchor = ((NodeEvent)evt).getAnchor();
if (evt.is(Event.ID.SequenceEnd)) {
if (!_parsingContext.inArray()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker(']', '}');
if (evt.is(Event.ID.DocumentEnd)) {
if (evt.is(Event.ID.DocumentStart)) {
代码示例来源:origin: com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
if (!evt.is(Event.ID.Scalar)) {
if (evt.is(Event.ID.MappingEnd)) {
if (!_parsingContext.inObject()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker('}', ']');
if (evt.is(Event.ID.Scalar)) {
JsonToken t = _decodeScalar((ScalarEvent) evt);
_currToken = t;
if (evt.is(Event.ID.MappingStart)) {
Mark m = evt.getStartMark();
MappingStartEvent map = (MappingStartEvent) evt;
if (evt.is(Event.ID.MappingEnd)) { // actually error; can not have map-end here
_reportError("Not expecting END_OBJECT but a value");
if (evt.is(Event.ID.SequenceStart)) {
Mark m = evt.getStartMark();
_currentAnchor = ((NodeEvent)evt).getAnchor();
if (evt.is(Event.ID.SequenceEnd)) {
if (!_parsingContext.inArray()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker(']', '}');
if (evt.is(Event.ID.DocumentEnd)) {
if (evt.is(Event.ID.DocumentStart)) {
代码示例来源:origin: pl.droidsonroids.yaml/snakeyaml
/**
* Check the type of the next event.
*/
public boolean checkEvent(Event.ID choice) {
peekEvent();
return currentEvent != null && currentEvent.is(choice);
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Check the type of the next event.
*/
public boolean checkEvent(Event.ID choice) {
peekEvent();
return currentEvent != null && currentEvent.is(choice);
}
代码示例来源:origin: harbby/presto-connectors
/**
* Check the type of the next event.
*/
public boolean checkEvent(Event.ID choices) {
peekEvent();
if (currentEvent != null) {
if (currentEvent.is(choices)) {
return true;
}
}
return false;
}
代码示例来源:origin: jenkinsci/kubernetes-ci-plugin
private static String findManifestKind(String yamlAsText) {
final Yaml yaml = new Yaml();
final StringReader stringReader = new StringReader(yamlAsText);
final Iterable<Event> parse = yaml.parse(stringReader);
boolean kindFound = false;
int countBetween = 0;
String kind = null;
for (Event event : parse) {
if (kindFound) {
countBetween++;
}
if (event.is(Event.ID.Scalar)) {
ScalarEvent scalarEvent = (ScalarEvent)event;
final String value = scalarEvent.getValue();
if (countBetween == 1) {
kind = value;
break;
}
if (value.equals("kind")) {
kindFound = true;
continue;
}
}
}
return kind;
}
}
代码示例来源:origin: org.milyn/milyn-smooks-all
if(e.is(ID.DocumentStart)) {
elementNameStack.push(documentName);
} else if(e.is(ID.Scalar)) {
ScalarEvent es = (ScalarEvent) e;
} else if(e.is(ID.MappingStart) || e.is(ID.SequenceStart)) {
CollectionStartEvent cse = (CollectionStartEvent) e;
typeStack.push(e.is(ID.SequenceStart) ? Type.SEQUENCE : Type.MAPPING);
} else if(e.is(ID.MappingEnd) || e.is(ID.SequenceEnd)) {
typeStack.pop();
} else if(e.is(ID.Alias)) {
String elementName = lastTypeIsArray(typeStack) ? arrayElementName : elementNameStack.pop();
代码示例来源:origin: smooks/smooks
if(e.is(ID.DocumentStart)) {
elementNameStack.push(documentName);
} else if(e.is(ID.Scalar)) {
ScalarEvent es = (ScalarEvent) e;
} else if(e.is(ID.MappingStart) || e.is(ID.SequenceStart)) {
CollectionStartEvent cse = (CollectionStartEvent) e;
typeStack.push(e.is(ID.SequenceStart) ? Type.SEQUENCE : Type.MAPPING);
} else if(e.is(ID.MappingEnd) || e.is(ID.SequenceEnd)) {
typeStack.pop();
} else if(e.is(ID.Alias)) {
String elementName = lastTypeIsArray(typeStack) ? arrayElementName : elementNameStack.pop();
代码示例来源:origin: org.dhatim/milyn-smooks-yaml
if(e.is(ID.DocumentStart)) {
elementNameStack.push(documentName);
} else if(e.is(ID.Scalar)) {
ScalarEvent es = (ScalarEvent) e;
} else if(e.is(ID.MappingStart) || e.is(ID.SequenceStart)) {
CollectionStartEvent cse = (CollectionStartEvent) e;
typeStack.push(e.is(ID.SequenceStart) ? Type.SEQUENCE : Type.MAPPING);
} else if(e.is(ID.MappingEnd) || e.is(ID.SequenceEnd)) {
typeStack.pop();
} else if(e.is(ID.Alias)) {
String elementName = lastTypeIsArray(typeStack) ? arrayElementName : elementNameStack.pop();
代码示例来源:origin: org.virtuslab/milyn-smooks-yaml
if(e.is(ID.DocumentStart)) {
elementNameStack.push(documentName);
} else if(e.is(ID.Scalar)) {
ScalarEvent es = (ScalarEvent) e;
} else if(e.is(ID.MappingStart) || e.is(ID.SequenceStart)) {
CollectionStartEvent cse = (CollectionStartEvent) e;
typeStack.push(e.is(ID.SequenceStart) ? Type.SEQUENCE : Type.MAPPING);
} else if(e.is(ID.MappingEnd) || e.is(ID.SequenceEnd)) {
typeStack.pop();
} else if(e.is(ID.Alias)) {
String elementName = lastTypeIsArray(typeStack) ? arrayElementName : elementNameStack.pop();
代码示例来源:origin: org.milyn/milyn-smooks-yaml
if(e.is(ID.DocumentStart)) {
elementNameStack.push(documentName);
} else if(e.is(ID.Scalar)) {
ScalarEvent es = (ScalarEvent) e;
} else if(e.is(ID.MappingStart) || e.is(ID.SequenceStart)) {
CollectionStartEvent cse = (CollectionStartEvent) e;
typeStack.push(e.is(ID.SequenceStart) ? Type.SEQUENCE : Type.MAPPING);
} else if(e.is(ID.MappingEnd) || e.is(ID.SequenceEnd)) {
typeStack.pop();
} else if(e.is(ID.Alias)) {
String elementName = lastTypeIsArray(typeStack) ? arrayElementName : elementNameStack.pop();
代码示例来源:origin: FasterXML/jackson-dataformats-text
if (!evt.is(Event.ID.Scalar)) {
if (evt.is(Event.ID.MappingEnd)) {
if (!_parsingContext.inObject()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker('}', ']');
if (evt.is(Event.ID.Scalar)) {
JsonToken t = _decodeScalar((ScalarEvent) evt);
_currToken = t;
if (evt.is(Event.ID.MappingStart)) {
Mark m = evt.getStartMark();
MappingStartEvent map = (MappingStartEvent) evt;
if (evt.is(Event.ID.MappingEnd)) { // actually error; can not have map-end here
_reportError("Not expecting END_OBJECT but a value");
if (evt.is(Event.ID.SequenceStart)) {
Mark m = evt.getStartMark();
_currentAnchor = ((NodeEvent)evt).getAnchor();
if (evt.is(Event.ID.SequenceEnd)) {
if (!_parsingContext.inArray()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker(']', '}');
if (evt.is(Event.ID.DocumentEnd)) {
if (evt.is(Event.ID.DocumentStart)) {
代码示例来源:origin: harbby/presto-connectors
if (!evt.is(Event.ID.Scalar)) {
if (evt.is(Event.ID.MappingEnd)) {
if (!_parsingContext.inObject()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker('}', ']');
if (evt.is(Event.ID.Scalar)) {
JsonToken t = _decodeScalar((ScalarEvent) evt);
_currToken = t;
if (evt.is(Event.ID.MappingStart)) {
Mark m = evt.getStartMark();
MappingStartEvent map = (MappingStartEvent) evt;
if (evt.is(Event.ID.MappingEnd)) { // actually error; can not have map-end here
_reportError("Not expecting END_OBJECT but a value");
if (evt.is(Event.ID.SequenceStart)) {
Mark m = evt.getStartMark();
_currentAnchor = ((NodeEvent)evt).getAnchor();
if (evt.is(Event.ID.SequenceEnd)) {
if (!_parsingContext.inArray()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker(']', '}');
if (evt.is(Event.ID.DocumentEnd)) {
if (evt.is(Event.ID.DocumentStart)) {
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
if (event.is(ID.StreamStart)) {
invoke(context, handler, "start_stream", runtime.newFixnum(YAML_ANY_ENCODING.ordinal()));
} else if (event.is(ID.DocumentStart)) {
handleDocumentStart(context, (DocumentStartEvent) event, tainted, handler);
} else if (event.is(ID.DocumentEnd)) {
IRubyObject notExplicit = runtime.newBoolean(!((DocumentEndEvent) event).getExplicit());
} else if (event.is(ID.Alias)) {
IRubyObject alias = stringOrNilFor(runtime, ((AliasEvent)event).getAnchor(), tainted);
} else if (event.is(ID.Scalar)) {
handleScalar(context, (ScalarEvent) event, tainted, handler);
} else if (event.is(ID.SequenceStart)) {
handleSequenceStart(context,(SequenceStartEvent) event, tainted, handler);
} else if (event.is(ID.SequenceEnd)) {
invoke(context, handler, "end_sequence");
} else if (event.is(ID.MappingStart)) {
handleMappingStart(context, (MappingStartEvent) event, tainted, handler);
} else if (event.is(ID.MappingEnd)) {
invoke(context, handler, "end_mapping");
} else if (event.is(ID.StreamEnd)) {
invoke(context, handler, "end_stream");
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
if (event.is(ID.StreamStart)) {
invoke(context, handler, "start_stream", runtime.newFixnum(YAML_ANY_ENCODING.ordinal()));
} else if (event.is(ID.DocumentStart)) {
handleDocumentStart(context, (DocumentStartEvent) event, tainted, handler);
} else if (event.is(ID.DocumentEnd)) {
IRubyObject notExplicit = runtime.newBoolean(!((DocumentEndEvent) event).getExplicit());
} else if (event.is(ID.Alias)) {
IRubyObject alias = stringOrNilFor(runtime, ((AliasEvent)event).getAnchor(), tainted);
} else if (event.is(ID.Scalar)) {
handleScalar(context, (ScalarEvent) event, tainted, handler);
} else if (event.is(ID.SequenceStart)) {
handleSequenceStart(context,(SequenceStartEvent) event, tainted, handler);
} else if (event.is(ID.SequenceEnd)) {
invoke(context, handler, "end_sequence");
} else if (event.is(ID.MappingStart)) {
handleMappingStart(context, (MappingStartEvent) event, tainted, handler);
} else if (event.is(ID.MappingEnd)) {
invoke(context, handler, "end_mapping");
} else if (event.is(ID.StreamEnd)) {
invoke(context, handler, "end_stream");
内容来源于网络,如有侵权,请联系作者删除!