Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheritance plugin remove fields #584

Open
Selfmade-RuLeZ opened this issue Jan 21, 2025 · 0 comments
Open

Inheritance plugin remove fields #584

Selfmade-RuLeZ opened this issue Jan 21, 2025 · 0 comments

Comments

@Selfmade-RuLeZ
Copy link

Selfmade-RuLeZ commented Jan 21, 2025

Hi guys,

I have a very special use case and wasted some days without a solution now. I have multiple WSDLs with one same type inside which are unable to be edited.
I want to create an abstract class to change some behaviour of this class.

Is it possible using JAXB and your Inheritance plugin to not generate all the fields of the complexType but leave those setters and getters inside?

abstract class Foo {
   protected String a = "someDefault"
}

class BarFromWSDL extends Foo {
  void setA(value: String) { a = value }
  String getA() { return a; }
}

Currently those values are overwritten by the generated class which generates a new field with the XML annotations and with protected accessor. Something like this:

class BarFromWSDL extends Foo {
    @XmlElement(required = true)
    protected String a;
  
    void setA(value: String) { this.a = value }
    String getA() { return a; }
}

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant