special0ne
special0ne

Reputation: 6263

how generate javaDoc from a jaxb file

i am working with Jaxb. and i would like to generate javaDoc files from these classes, is it the same way as i would do it to a regular java files?

Upvotes: 2

Views: 4028

Answers (3)

Jacob Zwiers
Jacob Zwiers

Reputation: 1102

A more direct approach (from the JAXB tutorial) which addresses the concerns above: http://jaxb.java.net/tutorial/section_5_4-Adding-Documentation.html#Adding%20Documentation

Upvotes: 2

Jacob Zwiers
Jacob Zwiers

Reputation: 1102

You can use the xs:annotation with xs:documentation and jaxb picks them up and makes them javadoc on the class.

Notes:

  • when the xs:documentation tag was outside the xs:complexType tag, it didn't pick up (understandably)
  • I'll assume the same can be done at the attribute / element level in the .xsd for fields of the class, but didn't try.
  • the output is ugly if you try to put HTML tags in the documentation. There's probably a way around that, but I didn't try that either.

    <xs:complexType name="TypeThatBecomesJavaClass">
      <xs:annotation>
       <xs:documentation>
           This becomes javadoc for TypeThatBecomesJavaClass
      </xs:documentation>
     </xs:annotation>
    ... etc ... 

Upvotes: 2

Bozho
Bozho

Reputation: 597274

Assuming you have generated .java files from .xsd - yes, they are regular classes which you can modify, comment and document.

Upvotes: 0

Related Questions