Home Dynamically adding attributes without changing the java object
Reply: 0

Dynamically adding attributes without changing the java object

user649
1#
user649 Published in April 22, 2018, 12:53 am

I want to add another new attributes the an field without changing the java object.

<field  attribute1 = "1"  attribute2 = "2"  attribute3 = "3"> value</filed>

@XmlRootElement(name = "field ")
public class Field 
{
    @XmlAttribute(name="attribute1")
    private String attribute1;

    @XmlAttribute(name="attribute2")
    private String attribute2;

    @XmlAttribute(name="attribute3")
    private String attribute3;
}

If I want to add a new attribute 4 to the XMLwithout changing the Field class(adding new field to the class and recompile).

Is there a way to do that?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.299242 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO