Closed leikingo closed 8 years ago
Mixed types are a quite weird in XJC. The problem is that customization does not gets attached to where the plugin expects it. Try attaching it to other elemenets like complexContent
etc.
Would you consider adding a test case (complex type named issueGH70Type
and customization) here:
https://github.com/highsource/jaxb2-basics/blob/master/tests/issues/src/main/resources/schema.xsd
I'd be grateful for a pull request.
Equals2
and HashCode2
are nonproblematic because they don't come via customization, they are added to all of the types. The problem here is customization.
I was expecting this. Too bad but thanks for the quick response. I created a pull request with the changes (hopefully correct since I was not able to run a build...)
Thank you for the PR!
Seems like XJC attaches the same customization twice - once to the type and once to the property.
So maybe there is a way to specify the binding more precise, thus the property gets ignored?
Nope. The binding is duplicated by XJC. I'll just mark implements
and extends
customizations on properties as acknowledged and just ignore them.
Here you go.
Awesome. That was fix! Thanks. Can we expect a release soon?
On it.
And again: great! Thanks very much!
Just a side question (sorry I don't know where to ask elsewhere): Is it possible to add the "mixed=true" via bindings? I was thinking about the annotate plugin but I the result would still be protected List<Element> any;
and thou I won't be able to access String contents...
I don't think so, not out of the box. You can write a plugin to do whatever you want (including adding mixed properties via customizations), but that's probably not what you're asking.
Okay...I was expecting this.Too bad. I'll keep the plugin approach in mind but actually this is currently way off my knowledge...
Released.
Great. I just tried the new release, works! Thanks again. Just to be sure, cause first I tried the wrong version number: version 1.11.1 instead of 0.11.1 is intended?
Yes, my bad. :( I'll rerelease 0.11.1, 1.11.1 should be ignored, can't be removed anymore.
0.11.1 released now. 1.11.1 is marked as PUBLISHED-BY-MISTAKE
.
Great. Currently the artifact is not yet available in maven central, but I think that will just take some time... Thanks again for the great work!
Its should be already:
http://repo1.maven.org/maven2/org/jvnet/jaxb2_commons/jaxb2-basics/0.11.1/
Interesting...okay, then it must be some kind of sync problem. I searched at mvnrepository.com but this showed only the 0.11.0 (not even the PUBISHED_BY_MISTAKE one...). Sorry, my fault.
mvnreposity.com does not index immediately.
Hi.
I'm having an issue with attaching a custom interface to a complexContent element which is set to mixed=true.
I modified the cxf sample project to reproduce the error.
The binding file:
And the simple interface:
When I try the compilation I get the following error:
The interesting thing is, when I remove the attribute "mixed=true" from the complexContent in the xsd, everything works fine. Unfortunately I need this flag to allow simple string and xml content.
Do you have any idea what's causing this error? All the other custom interfaces like Copy2, Equals2 work even with mixed set to true.
Thanks