I have an xsd schema that I cannot change. It creates the generated Java classes.
Suppose the classes are as follows:
class Data { protected List<Value> value; ... } class Value { ... }
Now I need my own MyValue to expand perfectly from Value.
class MyValue extends Value { Integer myOwnField1; Long anotherProperty; }
And be able to tell unmarshaller to use MyValue instead of Value when it parses an XML file.
Later, I could use the fact that MyValue can contain some useful new fields inside, do operations on them, change them, etc. Therefore, I want to expand the functionality that I have in the circuit without changing it.
How is it possible to replace the value of MyValue for unmarshaller?
Besides the obvious way to create a Map, where I can map an object that was created by unmarshaller to my own fields and properties in MyValue. I would like to avoid this.
source share