本文整理汇总了Java中org.codehaus.jackson.JsonParser.clearCurrentToken方法的典型用法代码示例。如果您正苦于以下问题:Java JsonParser.clearCurrentToken方法的具体用法?Java JsonParser.clearCurrentToken怎么用?Java JsonParser.clearCurrentToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.jackson.JsonParser
的用法示例。
在下文中一共展示了JsonParser.clearCurrentToken方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BackportedJacksonMappingIterator
import org.codehaus.jackson.JsonParser; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected BackportedJacksonMappingIterator(JavaType type, JsonParser jp, DeserializationContext ctxt, JsonDeserializer<?> deser) {
_type = type;
_parser = jp;
_context = ctxt;
_deserializer = (JsonDeserializer<T>) deser;
/* One more thing: if we are at START_ARRAY (but NOT root-level
* one!), advance to next token (to allow matching END_ARRAY)
*/
if (jp != null && jp.getCurrentToken() == JsonToken.START_ARRAY) {
JsonStreamContext sc = jp.getParsingContext();
// safest way to skip current token is to clear it (so we'll advance soon)
if (!sc.inRoot()) {
jp.clearCurrentToken();
}
}
}
示例2: _bind
import org.codehaus.jackson.JsonParser; //导入方法依赖的package包/类
protected Object _bind(JsonParser paramJsonParser)
throws IOException, JsonParseException, JsonMappingException
{
JsonToken localJsonToken = _initForReading(paramJsonParser);
Object localObject;
if ((localJsonToken == JsonToken.VALUE_NULL) || (localJsonToken == JsonToken.END_ARRAY) || (localJsonToken == JsonToken.END_OBJECT))
localObject = this._valueToUpdate;
while (true)
{
paramJsonParser.clearCurrentToken();
return localObject;
DeserializationContext localDeserializationContext = _createDeserializationContext(paramJsonParser, this._config);
if (this._valueToUpdate == null)
{
localObject = _findRootDeserializer(this._config, this._valueType).deserialize(paramJsonParser, localDeserializationContext);
continue;
}
_findRootDeserializer(this._config, this._valueType).deserialize(paramJsonParser, localDeserializationContext, this._valueToUpdate);
localObject = this._valueToUpdate;
}
}
示例3: _bindAsTree
import org.codehaus.jackson.JsonParser; //导入方法依赖的package包/类
protected JsonNode _bindAsTree(JsonParser paramJsonParser)
throws IOException, JsonParseException, JsonMappingException
{
JsonToken localJsonToken = _initForReading(paramJsonParser);
if ((localJsonToken == JsonToken.VALUE_NULL) || (localJsonToken == JsonToken.END_ARRAY) || (localJsonToken == JsonToken.END_OBJECT));
DeserializationContext localDeserializationContext;
for (Object localObject = NullNode.instance; ; localObject = (JsonNode)_findRootDeserializer(this._config, JSON_NODE_TYPE).deserialize(paramJsonParser, localDeserializationContext))
{
paramJsonParser.clearCurrentToken();
return localObject;
localDeserializationContext = _createDeserializationContext(paramJsonParser, this._config);
}
}
示例4: _readValue
import org.codehaus.jackson.JsonParser; //导入方法依赖的package包/类
protected Object _readValue(DeserializationConfig paramDeserializationConfig, JsonParser paramJsonParser, JavaType paramJavaType)
throws IOException, JsonParseException, JsonMappingException
{
JsonToken localJsonToken = _initForReading(paramJsonParser);
if ((localJsonToken == JsonToken.VALUE_NULL) || (localJsonToken == JsonToken.END_ARRAY) || (localJsonToken == JsonToken.END_OBJECT));
DeserializationContext localDeserializationContext;
for (Object localObject = null; ; localObject = _findRootDeserializer(paramDeserializationConfig, paramJavaType).deserialize(paramJsonParser, localDeserializationContext))
{
paramJsonParser.clearCurrentToken();
return localObject;
localDeserializationContext = _createDeserializationContext(paramJsonParser, paramDeserializationConfig);
}
}
示例5: MappingIterator
import org.codehaus.jackson.JsonParser; //导入方法依赖的package包/类
protected MappingIterator(JavaType paramJavaType, JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, JsonDeserializer<?> paramJsonDeserializer)
{
this._type = paramJavaType;
this._parser = paramJsonParser;
this._context = paramDeserializationContext;
this._deserializer = paramJsonDeserializer;
if ((paramJsonParser != null) && (paramJsonParser.getCurrentToken() == JsonToken.START_ARRAY) && (!paramJsonParser.getParsingContext().inRoot()))
paramJsonParser.clearCurrentToken();
}