0

I have a schema that generates:

public class A(){
    int f;
    int g;
}

And i wanted the generated class to be:

public class A(){
    String f;
    int g;
}

p.s.: I just want this ("f") specific field to be changed.

I've tried using jaxb binding (through the usage of the file binding.xjb) but didn't succeed. Is there a way to do this using this feature? Is this the proper way to do this?

lexicore
  • 42,748
  • 17
  • 132
  • 221
  • Possible duplicate of [Specify @XmlJavaTypeAdapter class via bindings file?](https://stackoverflow.com/questions/7837451/specify-xmljavatypeadapter-class-via-bindings-file) – lexicore Aug 29 '18 at 06:57
  • Please see the linked duplicate and also [javaType Binding Declarations](https://docs.oracle.com/javase/tutorial/jaxb/intro/custom.html#bnbbv). What you need is a `property` customization on the property you want to change, with ´baseType/javaType` customization specifying the adapter between `int` and `String`. – lexicore Aug 29 '18 at 07:02
  • I'll give it a check! Thanks! – Thiago Moratori Peixoto Aug 30 '18 at 20:38

0 Answers0