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

  • Home
  • SEARCH
  • 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 6897589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:11:15+00:00 2026-05-27T07:11:15+00:00

I have a problem with my custom JSON deserializer. I use Jackson to map

  • 0

I have a problem with my custom JSON deserializer.
I use Jackson to map JSON to Java and back. In some cases I need to write my own mapping.

I have an object (filter), which contains a set of another object(metaInfoClass). I try to deserialize the filter with Jackson, but I implemented an own deserializer for the inner object.
The JSON looks like this:

{     
 "freetext":false,
 "cityName":null,
 "regionName":null,
 "countryName":null,
 "maxResults":50,
 "minDate":null,
 "maxDate":null,
 "metaInfoClasses":
  [
     {
      "id":31,
      "name":"Energy",
      "D_TYPE":"Relevance"
     }
  ],
 "sources":[],
 "ids":[]
}

My deserializer just works fine, it finds all the fields etc.
The problem is, that somehow (no idea why) the deserializer gets invoked on the rest of the JSON string, so the sources token is getting processed, and so on.
This is very weird, since I don’t want to deserialize the big object, but only the inner metaInfoClass.

Even more weird: the CollectionDeserializer class keeps calling my deserializer with the json string even after it is ended. So nothing really happens, but the method gets called.

Any idea?

Thanks a lot!

  • 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-05-27T07:11:16+00:00Added an answer on May 27, 2026 at 7:11 am

    I was able to find a solution.
    I modified the implementation (in the deserialize method) to use to following code:

    JsonNode tree = parser.readValueAsTree();
    Iterator<Entry<String, JsonNode>> fieldNameIt = tree.getFields();
    
    while (fieldNameIt.hasNext()) {
      Entry<String, JsonNode> entry = fieldNameIt.next();
      String key = entry.getKey();
      String value = entry.getValue().getTextValue();
    
      // ... custom code here
    }
    

    So with this approach, it was parsing only the right piece of the code and it’s working right now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with my custom DataGridViewCell, indeed i tried to write to
I have such problem: I have 2 custom components, which have their own nesting
I have a problem regarding a JSON string grabbed from WordPress custom post meta.
I have some json formatted data that I parse with JSON.parse. The problem I
I have a problem with sending some custom headers to with a jQuery ajax
I seem to have a problem with getting MVC to fill in my custom
Problem I have a custom tab control using Chrome-shaped tabs that binds to a
I have a custom Jabber IM client and I'm having a problem with links.
My problem is similar to Django Passing Custom Form Parameters to Formset Ive have
I have designed a custom section handler before but I'm faced with a problem

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.