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 8472219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:00:08+00:00 2026-06-10T17:00:08+00:00

I have a List of javascript objects on my client side, which are a

  • 0

I have a List of javascript objects on my client side, which are a list of “events” that a user has executed. When the user is ready, I want to send this to the server. The order of events is important, so preserving the list order is necessary.

What I would like to do is to have a JSON library (don’t mind which one) to bind the JSON to some Event objects in my Java code, where Event is an abstract class, and I have 3 concrete classes that all extend Event (lets say EventA, EventB and EventC).

Ideal scenario would be something like

List<Event> events = jsonlibrary.deserialise(jsonString);

which may contain a list of items such as

[eventA, eventC, eventA, eventA, eventB]

Is this possible, or do I have to inspect the JSON tree manually, and deserialise the individual elements of the json array?

  • 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-10T17:00:10+00:00Added an answer on June 10, 2026 at 5:00 pm

    JSON objects are just key/value pairs and contain no type information. That means identifying the type of a JSON object automatically isn’t possible. You have to implement some logic on the server-side to find out what kind of event you are dealing with.

    I would suggest to use a factory method which takes a json string, parses it to find out what kind of Event it is, builds an Event object of the correct subclass and returns it.

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

Sidebar

Related Questions

i have list of rows that user select and i want to delete them,
I have the following code which is sorting a list of javascript objects in
In javascript, I have an array of objects that represents an arbitrarily deep list...
I have a list of data in javascript that looks like this: [[152, 48,
I have List I want to sort Desc by Priority, which is int and
I have a Javascript function that accepts a list of HTML nodes, but it
I have a list of javascript objects: var people = [ { 'name' :
Does Javascript supports Sets(list with unique objects only) ? I have found this link
I have an entity on the server called foo which has a list of
I have the following JavaScript to get a random image from a list of

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.