Giter Site home page Giter Site logo

Comments (5)

highsource avatar highsource commented on August 12, 2024

Why shouldn't inheritance:extends override xs:extension if you
explicitly specify it?

On Mon, Dec 14, 2015 at 3:54 PM, krokodylowy [email protected]
wrote:

If binding is extended with inheritance:extends=someClass then someClass
overrides
mainClass defined in element with xs:extension base=mainClass

If binding contains xjc:superClass name=someClass then behavior is correct
and
mainClass from xs:extension base=mainClass is not overriden by someClass
(someClass is added only to class without extends)


Reply to this email directly or view it on GitHub
#43.

from jaxb2-basics.

krokodylowy avatar krokodylowy commented on August 12, 2024

Because xjc:superClass doesn't do it. I tried use inheritance:extends as replacement but it's dangerous.
Super type declared in xs:extension is ignored

from jaxb2-basics.

highsource avatar highsource commented on August 12, 2024

inhertitance:extends is not meant as a replacement for xjc:superClass. Why should it be if you have xjc:superClass?

It is predictable and deterministic in what it does, so not exactly fits in my understanding of "dangerous".

from jaxb2-basics.

krokodylowy avatar krokodylowy commented on August 12, 2024

Why should it be if you have xjc:superClass
No. If I remove xjc:superClass and include inhertitance:extends results can be different
in java class code at line with 'class x extends y'

BTW.
I found it as workaround for #42. Code with xjc:superClass doesn't generate correct clone,hash and equals but inhertitance:extends do it correctly.

from jaxb2-basics.

highsource avatar highsource commented on August 12, 2024

I'm inclined to close it as it is works as designed. inheritance:extends will make the generated class extend the given class, no matter what.

If you really need the functionality "don't force extends", I'd see it as another issue. But I'd really like to know why it is needed. The only thing I can imaging is if you're using a mulinode XPath select in the binding to apply the customization to many nodes at once.

from jaxb2-basics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.