Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

246
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda