@@ -653,7 +653,7 @@ public ObjectNode retain(String... fieldNames) {
653
653
654
654
/**
655
655
* Method that will construct an ArrayNode and add it as a
656
- * field of this ObjectNode, replacing old value, if any.
656
+ * property of this {@code ObjectNode} , replacing old value, if any.
657
657
*<p>
658
658
* <b>NOTE</b>: Unlike all <b>put(...)</b> methods, return value
659
659
* is <b>NOT</b> this <code>ObjectNode</code>, but the
@@ -662,16 +662,16 @@ public ObjectNode retain(String... fieldNames) {
662
662
* @return Newly constructed ArrayNode (NOT the old value,
663
663
* which could be of any type)
664
664
*/
665
- public ArrayNode putArray (String fieldName )
665
+ public ArrayNode putArray (String propertyName )
666
666
{
667
667
ArrayNode n = arrayNode ();
668
- _put (fieldName , n );
668
+ _put (propertyName , n );
669
669
return n ;
670
670
}
671
671
672
672
/**
673
673
* Method that will construct an ObjectNode and add it as a
674
- * field of this ObjectNode, replacing old value, if any.
674
+ * property of this {@code ObjectNode} , replacing old value, if any.
675
675
*<p>
676
676
* <b>NOTE</b>: Unlike all <b>put(...)</b> methods, return value
677
677
* is <b>NOT</b> this <code>ObjectNode</code>, but the
@@ -680,29 +680,44 @@ public ArrayNode putArray(String fieldName)
680
680
* @return Newly constructed ObjectNode (NOT the old value,
681
681
* which could be of any type)
682
682
*/
683
- public ObjectNode putObject (String fieldName )
683
+ public ObjectNode putObject (String propertyName )
684
684
{
685
685
ObjectNode n = objectNode ();
686
- _put (fieldName , n );
686
+ _put (propertyName , n );
687
687
return n ;
688
688
}
689
689
690
690
/**
691
- * @return This node (to allow chaining)
691
+ * Method for adding an opaque Java value as the value of specified property.
692
+ * Value can be serialized like any other property, as long as Jackson can
693
+ * serialize it. Despite term "POJO" this allows use of about any Java type, including
694
+ * {@link java.util.Map}s, {@link java.util.Collection}s, as well as Beans (POJOs),
695
+ * primitives/wrappers and even {@link JsonNode}s.
696
+ * Method is most commonly useful when composing content to serialize from heterogenous
697
+ * sources.
698
+ *<p>
699
+ * NOTE: if using {@link JsonNode#toString()} (or {@link JsonNode#toPrettyString()}
700
+ * support for serialization may be more limited, compared to serializing node
701
+ * with specifically configured {@link ObjectMapper}.
702
+ *
703
+ * @param propertyName Name of property to set.
704
+ * @param pojo Java value to set as the property value
705
+ *
706
+ * @return This {@code ObjectNode} (to allow chaining)
692
707
*/
693
- public ObjectNode putPOJO (String fieldName , Object pojo ) {
694
- return _put (fieldName , pojoNode (pojo ));
708
+ public ObjectNode putPOJO (String propertyName , Object pojo ) {
709
+ return _put (propertyName , pojoNode (pojo ));
695
710
}
696
711
697
712
/**
698
713
* @since 2.6
699
714
*/
700
- public ObjectNode putRawValue (String fieldName , RawValue raw ) {
701
- return _put (fieldName , rawValueNode (raw ));
715
+ public ObjectNode putRawValue (String propertyName , RawValue raw ) {
716
+ return _put (propertyName , rawValueNode (raw ));
702
717
}
703
718
704
719
/**
705
- * @return This node (to allow chaining)
720
+ * @return This {@code ObjectNode} (to allow chaining)
706
721
*/
707
722
public ObjectNode putNull (String fieldName )
708
723
{
0 commit comments