jax-doclets
jax-doclets copied to clipboard
does jax-doclets support EclipseLink moxy?
My current project is using EclipseLink moxy. Some code is using @XmlPath of EclipseLink moxy to define a fine mapping between Java object and xml schema. And I also using jax-doclets to generate docs. Now my RestFul API is working as I expected with fine mapping. But the API doc which is generated by jax-doclets didn't follow my fine mapping setting on @XmlPath .
So my question is :
does jax-doclets support EclipseLink moxy?
some of my code like this :
@XmlPath("phones/phone[@type='home']/text()")
public String getHomePhone() {
return homePhone;
}
@XmlPath("phones/phone[@type='work']/text()")
public String getWorkPhone() {
return workPhone;
}
.....
No we don't support it, but if you want to add support for it your contribution will be welcome :)
Hi Stphane,
I took a brief look at the source code of jax-doclets. It did a great job for creating restful API docs.
For my story, the standard JAXB implementation is not enough powerful and flexible. So I turned into EclipseLink moxy, another implementation of JAXB.
My though about how to change jax-doclets to support moxy is :
(1) provide an way to pass in customized JAXB implementation (2) provide an way to pass in Java Object tree which is created by customized implementation when find a class on restful API interface (3) use standard JAXB marshal mechanism to generate sample xml from the step2's Java Object (4) provide a standard Java Object tree creating process in order to cover basic function, some mock framework maybe help. Users can extend some class in order to provide partial customization.
Like to hear what you are thinking. Sincerely Justin
2011/9/27 Stphane pardaud < [email protected]>
No we don't support it, but if you want to add support for it your contribution will be welcome :)
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-2208113
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.
Currently all the JAXB mapping is done by hand based on the spec and what we had time to support. You're more than welcome to add support for whatever else you want supported.
I tried my thought and it works, but the objects created on that way sometimes can't pass schema validation. Seems it has another better way to generate sample xml: (1) get JAXB implementation (2) generate xml schema for target classes (3) generate xml sample from schema
In this way, it can generate a valid xml sample.
2011/9/28 Stphane pardaud < [email protected]>
Currently all the JAXB mapping is done by hand based on the spec and what we had time to support. You're more than welcome to add support for whatever else you want supported.
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-2229697
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.
Hey if you manage to get this to work, be my guest. The current solution is a hack but happens to work well enough for most users and was relatively easy to do. Also it supports links to sub-elements and is concise. If you can do better, be my guest and I will include it.
Hi,
I have to pause the implementation of the first thought for weeks because I was given some high priority tasks. It still needs some coding to finish it.
I can send all my half-way coding if you like or just wait for weeks? For the second though I thought we need some third-party jars. I found some discuss on it, But didn't try: http://stackoverflow.com/questions/17106/how-to-generate-sample-xml-documents-from-their-dtd-or-xsd
Sincerely Justin
2011/10/4 Stphane pardaud < [email protected]>
Hey if you manage to get this to work, be my guest. The current solution is a hack but happens to work well enough for most users and was relatively easy to do. Also it supports links to sub-elements and is concise. If you can do better, be my guest and I will include it.
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-2291439
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.
I can wait, no rush :) Thanks for your help!
Hi Stphane pardaud,
Now I am back to the javadocs again.
First I summary What I am going to do:
let jax-doclet can handle customized JAXB implementation.
So I assume :
Any customized JAXB implementation can generate xml schema for all
entity Java bean even without container supporting
Of course the one I am working is Eclipse_Moxy, which can meet this requirement.
Then I Summary what I am going to do: (1) Define an interface "XmlSchemaFactory", will let user customize their own implementation and pass the target schema to our doclet,
(2) I will create an XmlGenerator class will generate sample xml data based on the schema which is passed into in the first step. This step will use a third party jar: xsom, http://xsom.java.net/userguide.html
(3) customized xmlGenerator: XmlGenerator is not good for every schema because it do a lot of assumption. So I will create another mechanism to do customized implementation.
I did a simple implementation of step 1 and 2, For step3 , My first thought is to pass XPATH into our doclet and our doclet will adjust generated xml based on those XPATH.
I'd like to hear your idea.
Sincerely Justin
2011/10/4 Stphane pardaud < [email protected]>
I can wait, no rush :) Thanks for your help!
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-2291671
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.
Another issue is that some JAXRS method return javax.ws.rs.core.Response, which warp up real return type . I am thinking how to handle it.
2012/1/12 Justin Wu [email protected]
Hi Stphane pardaud,
Now I am back to the javadocs again.
First I summary What I am going to do:
let jax-doclet can handle customized JAXB implementation.
So I assume :
Any customized JAXB implementation can generate xml schema for all
entity Java bean even without container supporting
Of course the one I am working is Eclipse_Moxy, which can meet this requirement.
Then I Summary what I am going to do: (1) Define an interface "XmlSchemaFactory", will let user customize their own implementation and pass the target schema to our doclet,
(2) I will create an XmlGenerator class will generate sample xml data based on the schema which is passed into in the first step. This step will use a third party jar: xsom, http://xsom.java.net/userguide.html
(3) customized xmlGenerator: XmlGenerator is not good for every schema because it do a lot of assumption. So I will create another mechanism to do customized implementation.
I did a simple implementation of step 1 and 2, For step3 , My first thought is to pass XPATH into our doclet and our doclet will adjust generated xml based on those XPATH.
I'd like to hear your idea.
Sincerely Justin
2011/10/4 Stphane pardaud < [email protected]>
I can wait, no rush :) Thanks for your help!
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-2291671
Justin Wu, Software Developer, Tungle [email protected] m. +1.519.498.8138 w. +1.519.746.8779 Scheduling made easy. Get Tungle at www.tungle.com. - - - - - This e-mail is privileged, confidential, and subject to copyright. Any unauthorized use or disclosure is prohibited.
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.
Well, I just suspect most users of JAXB will be like me and not even have or care about schemas or extensions. It'd be great to add support for extensions such as @XmlPath
, but we can do that on an ad-hoc basis, I certainly don't want to require schemas. I'm fine with making schemas optional, but the simple/default case should still work like now (though I agree the example XML can be improved, but it cannot require more info from the user).
Even I don't care the xml schema. The only purpose of those schema is to generate sample xml.
My change is small. the main is part leaving to the customized implementation.
Of course I can keep it only for myself if you don't like the idea.
2012/1/27 Stphane pardaud < [email protected]
Well, I just suspect most users of JAXB will be like me and not even have or care about schemas or extensions. It'd be great to add support for extensions such as
@XmlPath
, but we can do that on an ad-hoc basis, I certainly don't want to require schemas. I'm fine with making schemas optional, but the simple/default case should still work like now (though I agree the example XML can be improved, but it cannot require more info from the user).
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-3684346
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.
No I'm certainly interested :)
how can I check in the code?
2012/1/27 Stphane pardaud < [email protected]
No I'm certainly interested :)
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-3686638
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.
do you need a review on it?
2012/1/27 Justin Wu [email protected]
how can I check in the code?
2012/1/27 Stphane pardaud < [email protected]
No I'm certainly interested :)
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-3686638
Justin Wu, Software Developer, Tungle [email protected] m. +1.519.498.8138 w. +1.519.746.8779 Scheduling made easy. Get Tungle at www.tungle.com. - - - - - This e-mail is privileged, confidential, and subject to copyright. Any unauthorized use or disclosure is prohibited.
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.
Yes please, make a pull request.
Please see the attachment and review my changes.
the file build_sample.xml is an ant script sample.
2012/1/27 Stphane pardaud < [email protected]
Yes please, make a pull request.
Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/11#issuecomment-3686714
Justin Wu, Software Developer, Tungle
[email protected]
m. +1.519.498.8138
w. +1.519.746.8779
Scheduling made easy. Get Tungle at www.tungle.com.
- - - - -
This e-mail is privileged, confidential, and subject to copyright.
Any unauthorized use or disclosure is prohibited.