本文整理了Java中org.codehaus.jackson.node.ObjectNode.nullNode()
方法的一些代码示例,展示了ObjectNode.nullNode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectNode.nullNode()
方法的具体详情如下:
包路径:org.codehaus.jackson.node.ObjectNode
类名称:ObjectNode
方法名:nullNode
暂无
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
public void putNull(String fieldName)
{
_put(fieldName, nullNode());
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
/**
* Method for adding given properties to this object node, overriding
* any existing values for those properties.
*
* @param properties Properties to add
*
* @return This node (to allow chaining)
*
* @since 1.3
*/
public JsonNode putAll(Map<String,JsonNode> properties)
{
if (_children == null) {
_children = new LinkedHashMap<String, JsonNode>(properties);
} else {
for (Map.Entry<String, JsonNode> en : properties.entrySet()) {
JsonNode n = en.getValue();
if (n == null) {
n = nullNode();
}
_children.put(en.getKey(), n);
}
}
return this;
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
/**
* Method that will set specified field, replacing old value,
* if any.
*
* @param value to set field to; if null, will be converted
* to a {@link NullNode} first (to remove field entry, call
* {@link #remove} instead)
*
* @return Old value of the field, if any; null if there was no
* old value.
*/
public JsonNode put(String fieldName, JsonNode value)
{
if (value == null) { // let's not store 'raw' nulls but nodes
value = nullNode();
}
return _put(fieldName, value);
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Boolean value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, booleanNode(value.booleanValue()));
}
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Integer value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, numberNode(value.intValue()));
}
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Float value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, numberNode(value.floatValue()));
}
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Long value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, numberNode(value.longValue()));
}
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Double value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, numberNode(value.doubleValue()));
}
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
/**
* Method for setting value of a field to specified binary value
*/
public void put(String fieldName, byte[] v) {
if (v == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, binaryNode(v));
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void putNull(String fieldName)
{
_put(fieldName, nullNode());
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Method for adding given properties to this object node, overriding
* any existing values for those properties.
*
* @param properties Properties to add
*
* @return This node (to allow chaining)
*
* @since 1.3
*/
public JsonNode putAll(Map<String,JsonNode> properties)
{
if (_children == null) {
_children = new LinkedHashMap<String, JsonNode>(properties);
} else {
for (Map.Entry<String, JsonNode> en : properties.entrySet()) {
JsonNode n = en.getValue();
if (n == null) {
n = nullNode();
}
_children.put(en.getKey(), n);
}
}
return this;
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Method that will set specified field, replacing old value,
* if any.
*
* @param value to set field to; if null, will be converted
* to a {@link NullNode} first (to remove field entry, call
* {@link #remove} instead)
*
* @return Old value of the field, if any; null if there was no
* old value.
*/
public JsonNode put(String fieldName, JsonNode value)
{
if (value == null) { // let's not store 'raw' nulls but nodes
value = nullNode();
}
return _put(fieldName, value);
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Integer value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, numberNode(value.intValue()));
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Float value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, numberNode(value.floatValue()));
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Long value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, numberNode(value.longValue()));
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Double value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, numberNode(value.doubleValue()));
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Alternative method that we need to avoid bumping into NPE issues
* with auto-unboxing.
*
* @since 1.9
*/
public void put(String fieldName, Boolean value) {
if (value == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, booleanNode(value.booleanValue()));
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Method for setting value of a field to specified binary value
*/
public void put(String fieldName, byte[] v) {
if (v == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, binaryNode(v));
}
}
代码示例来源:origin: ovea-deprecated/jetty-session-redis
/**
* Method for setting value of a field to specified binary value
*/
public void put(String fieldName, byte[] v) {
if (v == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, binaryNode(v));
}
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl
/**
* Method for setting value of a field to specified binary value
*/
public void put(String fieldName, byte[] v) {
if (v == null) {
_put(fieldName, nullNode());
} else {
_put(fieldName, binaryNode(v));
}
}
内容来源于网络,如有侵权,请联系作者删除!