本文整理汇总了Java中org.codehaus.jackson.node.NullNode.instance方法的典型用法代码示例。如果您正苦于以下问题:Java NullNode.instance方法的具体用法?Java NullNode.instance怎么用?Java NullNode.instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.jackson.node.NullNode
的用法示例。
在下文中一共展示了NullNode.instance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _bindAsTree
import org.codehaus.jackson.node.NullNode; //导入方法依赖的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);
}
}
示例2: readTree
import org.codehaus.jackson.node.NullNode; //导入方法依赖的package包/类
public JsonNode readTree(InputStream paramInputStream)
throws IOException, JsonProcessingException
{
Object localObject = (JsonNode)readValue(paramInputStream, JSON_NODE_TYPE);
if (localObject == null)
localObject = NullNode.instance;
return (JsonNode)localObject;
}
示例3: readTree
import org.codehaus.jackson.node.NullNode; //导入方法依赖的package包/类
public JsonNode readTree(File paramFile)
throws IOException, JsonParseException
{
Object localObject = (JsonNode)objectMapper().readValue(paramFile, JsonNode.class);
if (localObject == null)
localObject = NullNode.instance;
return (JsonNode)localObject;
}
示例4: readTree
import org.codehaus.jackson.node.NullNode; //导入方法依赖的package包/类
public JsonNode readTree(File src)
throws IOException, JsonParseException
{
JsonNode n = objectMapper().readValue(src, JsonNode.class);
return (n == null) ? NullNode.instance : n;
}
示例5: readTree
import org.codehaus.jackson.node.NullNode; //导入方法依赖的package包/类
/**
* Method to deserialize JSON content as tree expressed
* using set of {@link JsonNode} instances. Returns
* root of the resulting tree (where root can consist
* of just a single node if the current event is a
* value event, not container).
*
* @param cfg Specific deserialization configuration to use for
* this operation. Note that not all config settings can
* be changed on per-operation basis: some changeds only take effect
* before calling the operation for the first time (for the mapper
* instance)
*
* @since 1.1
*/
public JsonNode readTree(JsonParser jp, DeserializationConfig cfg)
throws IOException, JsonProcessingException
{
/* 02-Mar-2009, tatu: One twist; deserialization provider
* will map Json null straight into Java null. But what
* we want to return is the "null node" instead.
*/
JsonNode n = (JsonNode) _readValue(cfg, jp, JSON_NODE_TYPE);
return (n == null) ? NullNode.instance : n;
}