Can XDOCLET work with non java files containing javadoc comments

Discussions

General J2EE: Can XDOCLET work with non java files containing javadoc comments

  1. Hello,
    I am new to XDOCLET but with whatever little I have read I see that for XDOCLET to work properly the XDOCLET tags need to be in javadoc style. But does the file containing these Javadoc style comments have to be a .java file. Can it not be any file which contains XDOCLET tags.

    Thanks,
    Sameer
  2. So far as I know, the answer is no. Since XDoclet piggy-backs on Javadoc, it is limited to files that Javadoc can process. Javadoc requires both the source code and the compile Java classes. Therefore, Javadoc (and XDoclet) can't process non-Java files.
  3. So far as I know, the answer is no. Since XDoclet piggy-backs on Javadoc, it is limited to files that Javadoc can process. Javadoc requires both the source code and the compile Java classes. Therefore, Javadoc (and XDoclet) can't process non-Java files.
    This is not exactly the truth. It dependes on which version of XDoclet is used. The 1.2 version is using xjavadoc which is performs faster than the JavaDoc Doclets. XDoclet 2 is using qdox. Older version used a JavaDoc Doclet.

    But in for both version I would say no, as it usally means that you have to write a source parser. qdox used JFlex and BYacc/J as parser generator . JavaCC and ANTLR would be also fine alternatives.
  4. Thanks for the replies all of you. I have two questions-

    1. Is XDOCLET 2 released as yet. I tried to look for it but it seems its not released as yet?
    2. How difficult is it to write your own parser? It might still save me a lot of effort than to create the entire application from scratch.

    Sameer
  5. The current XDoclet 2 source code appears to be at: http://xdoclet.codehaus.org/

    It hasn't been released, but you could alway pull stuff out of the CVS. I haven't bothered; it looks pretty unfinished at the moment.

    As for writing your own parser, it depends on what your needs are. After all, source code files are just text files, so all you are really doing is writing a program to parse a text file. I wrote a program to parse a JavaScript file and produce Javadoc-style documentation in about a day.

    If you want to build a full language parser using the tools the other poster mentioned, it would be a more lengthy undertaking. To be honest, I haven't done anything that ambitious. I do most of my code generation though relatively simple Velocity or XSLT base programming.