Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8244537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:53:05+00:00 2026-06-07T21:53:05+00:00

I have a new JsonNode that I created JsonNode jNode = new ObjectCodec().createObjectNode(); with

  • 0

I have a new JsonNode that I created

JsonNode jNode = new ObjectCodec().createObjectNode();

with this node, how do I then add key value pairs within so that I can construct this new node with the new values? What I read in http://www.cowtowncoder.com/blog/archives/2011/08/entry_460.html mentioned about using

jNode.with("newNode").put("key1","value1");

But looking at the APIs for Jackson’s JsonNode (v1.8) does not show any method as such.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:53:07+00:00Added an answer on June 7, 2026 at 9:53 pm

    These methods are in ObjectNode: the division is such that most read operations are included in JsonNode, but mutations in ObjectNode and ArrayNode.

    Note that you can just change first line to be:

    ObjectNode jNode = mapper.createObjectNode();
    // version ObjectMapper has should return ObjectNode type
    

    or

    ObjectNode jNode = (ObjectNode) objectCodec.createObjectNode();
    // ObjectCodec is in core part, must be of type JsonNode so need cast
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When we have new in C#, that personally I see only as a workaround
I have a new service that I have written and need to register it
I have my new macbook air. I have created one test application. now i
I have a new ParameterPart entity that is related to a new InputOutputMap. The
I have a new Codeblocks install with mingw32 compiler. Created new c++ console project
Sort of how this website shows a bar on top when you have new
I have new XmlDocument object, i.g. xml is created during my program... I want
I have a web project that used to use Forms Authentication. I have new
I am attempting to bulk move my files to new folders that have new
I have a SQLite database that is created by reading some data in PDF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.