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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:46:37+00:00 2026-06-06T14:46:37+00:00

When talking about object marshalling in most of the Java-XML data binding APIs, it

  • 0

When talking about object marshalling in most of the Java-XML data binding APIs, it has been said that the the XML file is recreated from the user defined classes from memory? I’m quite confusing about saying (user defined classes from memory). I know using reflection will help to get the class names and/or fields in case of need for implementing the marshalling process, but how the data (values for the elements or attributes) can be accessed?

Is there any one can explain this process a little?

thanks

  • 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-06T14:46:38+00:00Added an answer on June 6, 2026 at 2:46 pm

    You can access them using reflection. Reflection doesn’t returns just the name but the value that a field hold for example.

    A simple example could be obtained with the following code:

    import java.lang.reflect.Field;
    
    public class ReflectionTest {
    
        public static void main(final String[] args) throws Exception {
            Object obj = new Person("Person Name", 20);
    
            for (Field f : obj.getClass().getDeclaredFields()) {
                f.setAccessible(true);
                System.out.println(f.getName() + " = " + f.get(obj));
            }
        }
    
        public static class Person {
            private final String name;
            private final int age;
    
            public Person(final String name, final int age) {
                super();
                this.name = name;
                this.age = age;
            }
    
        }
    
    }
    

    This code would print out:

    name = Person Name
    age = 20
    

    As you can see the values of each field is accessed using method Field.get(Object). You can find more out here.

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

Sidebar

Related Questions

I'm talking about a detached object, that later I want to update with saveOrUpdate().
Lots of people are talking about keeping an CABasicAnimation object around after it has
Talking about javax.crypto.Cipher I was trying to encrypt data using Cipher.getInstance(RSA/None/NoPadding, BC) but I
Talking about SimpleModal the jQuery plugin. Most of the time I think it is
Im talking about performing a deep recursion for around 5+ mins, something that you
Problem! I Have the following input (rules) from a flat file (talking about numeric
I have a root object that has a property that is a collection. For
I'm talking about methods like this: $object->method()->method1('param')->method2('param'); Those are created by returning the object
I am talking about C# language here. Definition of Object.Equals(Object) method in msdn is:
There is a big difference - talking about transfer rate, object serialization - to

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.