下面列出了怎么用com.fasterxml.jackson.core.io.JsonEOFException的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* @since 2.8
*/
protected void _reportInvalidEOF(String msg, JsonToken currToken) throws JsonParseException {
throw new JsonEOFException(this, currToken, "Unexpected end-of-input"+msg);
}
/**
* @deprecated Since 2.8 use {@link #_reportInvalidEOF(String, JsonToken)} instead
*/
@Deprecated // since 2.8
protected void _reportInvalidEOF(String msg) throws JsonParseException {
throw new JsonEOFException(this, null, "Unexpected end-of-input"+msg);
}
@Test
void fromJsonStringShouldThrowOnBrokenJson() {
assertThatThrownBy(() -> AttributeValue.fromJsonString("{\"serializer\":\"StringSerializer\",\"value\": \"Missing closing bracket\""))
.isInstanceOf(JsonEOFException.class);
}