本文整理匯總了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();
}