I saw many examples using multiple classes to define attributes at different levels. I have a lot of elements that need an additional entry in the XML, so it would make sense to have many files for this. My overall main goal is to add more data to an existing class.
I am trying to change this
<definition>
<rows>
<row>1</row>
</rows>
<columns>
<column>2</column>
</columns>
to either modify (change) or add attributes to each entry. I have these values in a map (1=Test1). I am trying to do something like this.
<definition>
<rows>
<row name="Test1">1</row>
</rows>
<columns>
<column name="Test2">2</column>
</columns>
or this (The only problem with this is that I have these rows/cols stored as Integers in the source, and putting names would be in a string format)
<definition>
<rows>
<row>Test1</row>
</rows>
<columns>
<column>Test2</column>
</columns>
Here is what I currently have in java.
public class Definition{
@XmlElementWrapper(name="rows")
@XmlElement(name="row")
@XmlElement (name="row_names")
...
@XmlElementWrapper(name="cols")
@XmlElement(name="col")
@XmlElement (name="col_names")