Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

247
Views
Java Reflection to handle the dynamic object mapping of object we got from parsing xml to pojo

I have a scenario where I need to handle xml data that will parsed into object. Requirement is to dynamically map those variables. For example suppose I have an xml :

<request>
         <member>
            <id>abc</id>
            <details>
               <ssn>19</ssn>
               <verification>
                  <indicator>Y</indicator>
                  <fedInd>N</fedInd>
                  <status>XY</status>
               </verification>
            </details>
            <taxStatus>
               <LastYrStatus>NFT</LastYrStatus>
               <ThisYrStatus>MFT</ThisYrStatus>
            </taxStatus>           
         </member>
    </request>

Now looking at the xml I want to map the field indicator whose exact path is : request|member|details|verification|indicator the dynamic mapping should give me the getter of these variables from respective java object like getRequest().getMember().getDetails().getVerification().getIndicator() so that if in future path of xml tag got change I don't have to make so many changes in the code it will be dynamically mapped with the new tag location. Can anyone reply how to handle this situation using java reflection or through any other way.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

XML are based on xsds, why don't you provide XSDs for parsing, so that whenever the XSD is changed the data accordingly provided.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!