Embedding html in .java file comments

for years now the convention has been to liberally use html in java source code comments
to beautify javadocs. for example, i have taken this out of the source code for java.lang.System:
* The <code>System</code> class contains several useful class fields
* and methods. It cannot be instantiated.
* <p>
* Among the facilities provided by the <code>System</code> class
* are standard input, standard output, and error output streams;
* access to externally defined "properties"; a means of
* loading files and libraries; and a utility method for quickly
* copying a portion of an array.
* @author Arthur van Hoff
* @version 1.125, 12/03/01
* @since JDK1.0
the problem i see with this is that the tags must be stripped if one is producing
documentation in formats other than html (swing doclet, or pdf doclet, or any
application of xml).
aren't we forever tying ourselves to html? is there any intention on the part of
j2se/j2ee developers to discontinue this practice? i've begun working on a xul
doclet and am having to enclose the documentation in cdata to maintain the
validity of the document i produce (i could also just strip out the tags of course).
thanks, eitan

Hi Eitan,
I see little problem as long we provide a way to
parse whatever format is being used.
Please take a look at the commentdom package in
the "Doclet Refactoring Design" under "What's New"
on the right side of the Javadoc home page:
http://java.sun.com/j2se/javadoc/
Here's its description:
com.sun.tools.doclet.toolkit.util.commentdom
DocComment to DOM Translator - Documentation comment contains embedded HTML,
Javadoc inline tags as well as custom inline tags. This package will contain classes that will help
generate a DOM tree for the documentation comment. This can be of great help for doclets that
generate documentation in formats other than HTML. Such doclets don?t have to undergo the
tedious task of parsing the documentation comments for all the tags. Doclets can then directly
traverse the DOM tree and then convert the tags to appropriate format.
The DOM tree will adhere to the doccomment DTD that will be published later. The DTD will
allow required HTML tags along with their attributes as defined in HTML4.0 specifications. The
DTD will also support Javadoc-defined inline tags as well as user-defined custom inline tags.
We plan for the doclet toolkit other than this part to be in Tiger;
we haven't committed dates to delivering this piece, but feel it
would be an important part of the toolkit.
-Doug Kramer
Javadoc team

Similar Messages

  • Embedding HTML inside Flash File

    HI.
    I would like to inquire on how to embed a HTML file insides a
    Flash File.
    This is the scenario, I have several HTML files, e.g. a.html,
    b.html, c.html.
    Where there would be a links inside that flash file, to open
    a.html, b.html, and c.html (not a new browser).
    How can I do this? Guides / Tutorials would help.
    I am a bit a newbie in the world of Flash. Thank you in
    advance.
    /928 :)

    mauve928,
    > I would like to inquire on how to embed a HTML file
    insides
    > a Flash File.
    Dynamic text fields do support some HTML formatting, but
    it's important
    to understand that at this time, the supported tags comprise
    only a very
    small subset of the full HTML specification. (Search the Help
    panel for
    "supported HTML tags," and you'll see which ones they are.)
    As such, Flash
    Player simply doesn't load HTML files.
    What Flash Player does load is XML, so if your documents are
    formatted
    as XHTML (that is, technically XML), you'll have the
    beginnings of something
    you can use. Flash won't necessarily be able to display
    elements it doesn't
    understand (e.g. tables), but because the document is XML,
    you'll be able to
    parse those tags and extract information from them, using
    what Flash *is*
    capable of displaying.
    I wrote a series at Community MX not long ago that makes
    some
    exploration into what you're after.
    http://www.communitymx.com/abstract.cfm?cid=02395
    The first article (of three) is free, and you sign up for a
    non-obligatory free trial to read the rest.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • @(#) in Java file comment

    What is this @(#) found in some Java source files?
    For example, the first line in String.java in IBM jdk is the following:
    * @(#)src/classes/sov/java/lang/String.java, core, hs131, 20021024 1.23.2.2Does the first line have to so with source control? What does the @(#) achieve here?
    thanks

    It's a "magic cookie" identifier that's searched for by the Unix command "what" (or maybe "whatis") that finds that particular sequence, and outputs the string following it. It's basically a versioning tool.

  • How to keep HTML code in the applet source (.java) file itself?

    Hi,
    How to keep HTML code (APPLET tag) in the applet source (.java) file itself?
    Please give an example?
    thank you,

    R6i wrote:
    ...What I mean is without writing external HTML file, how to run an applet (during practice)?'Practice'? What does that mean? During development? If that is what you are referring to, add an applet tag at the top of YourApplet.java inside a Java comment area. Then AppletViewer (in recent SDKs) can then run it with just..
    prompt:javac YourApplet.java
    prompt:// the '.java' extension is not a mistake
    prompt:appletviewer YourApplet.javaIf you do not mean 'during development', then that brings us back to +"What advantages do you see that is bringing to the end user?".+

  • PDF to html conversion with embedded images in java

    hi all,
    i want to convert any pdf file to its html equivalent. currently i am using PDFBOX java api to do that. it works fine with simple pdf files having no images, but if there are embedded images in pdf file then it do not show these images.
    anyone who has clue of solving this problem. i can convert individual pdf pages to jpg pictures if all embedded images would also be in these pictures.
    help me regarding pointers to other APIs, code snippets etc that can solve my purpose.
    thanks in advance

    Hi..
    really soorry i am not having any solution for u.
    But i am having one problem regarding pdf box, i think u know pdf box, i am reading japanese file using pdf box, its giveing
    caught a class java.io.IOException
    with message: Unknown encoding for 'UniJIS-UCS2-H'
    I have wrriten code like this.....
    PDDocument pdfDocument = null;
    PDFParser parser = new PDFParser( new FileInputStream(file));
    parser.parse();
    pdfDocument = parser.getPDDocument();
    PDFTextStripper stripper = new PDFTextStripper();
    String text = stripper.getText(pdfDocument);
    reader = new StringReader(text);

  • Replacing Class definition comments in java files.

    Hi to all,
    Im trying to implement a java file replacer that opens about a thousand java files and replaces the first comment lines. That is to say assume that these thousand java files have this comment at the beginning of them:
    *Date      Author     Changes
    *${date} ${author} initial release
    My application should find these comments and replace them with
    * Project Name:
    * File: ${file_name}
    * Purpose:
    * History:
    *Date      Author     Changes
    *${date} ${author} initial release
    I dont need any GUI. just I will print the changed files to console.
    My question is is there any example applications you guys can suggest and should I use XML and XSL to implement this application?
    Any suggestions are highly appriciated.
    Best Regards.
    Metan

    How is XML going to help you? Also for a task which you describe its easier to replace it wholesale rather than compare what is present and what is not. If you want to selectively want to remove stuff you might run into issues where you have to compare the name of the file, and you would not even know if the documentation already existing is the right one if you do not replace.
    If at all you wish to go with XML it is better with XSL transforms but I guess that would be an overkill for the purpose.
    As previously suggested perl is a very good option, or if you have unix operating system you can even try some basic shell scripting to do your job
    Thanks

  • How to call a html file in a java file

    how to call a html file inside a java file ?

    Hopeless. Are you by any chance a rare gas? You seem completely inert. LOL You totally pwned him there :rolls eyes:
    well, no, I think he's looking for something to this degree:
    in HTML, there is a mailto: command that makes the system default handled way to email emails open up. He's looking for a command thats very nice and opens a html file in the system default browser.
    So, Dick, Runtime.exec would work execpt that he needs a way to find the default system browser to call exec on, AND he has to know how to pass html file locations to the executable via command line arguments
    He just didnt try to phrase it at all :P

  • How to run .html file from .java file..?

    Hi All,
    I was just trying as mentioned in the subject of how to run an html file from a java file.We have runtime class which inturn is having exec method which returns process but it supports only .exe as an argument .Is there any way to do this???
    Thanks in advance.

    viswa07 wrote:
    You mean to say Desktop class in java...???I'm so sorry, I thought you knew enough Java to look up the API.
    [This link|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html] might be more at your level.
    db

  • Where do i place my html files,classes and Java files

    Can any one plz help me out here. I'm using Tomcat3.2.1 to
    run my servlets, I have written the servlets and gotten
    tomcat to run as well. What confuses me now is where my
    files should be placed.
    - Do i have to create a special directory to contain my html
    files ?
    - another directory for my servlet classes ?
    - how about my .java files ?
    - and how should i call my servlet from the html code ?
    HEEEEEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLPPPPPPPPPPPP!!!!!!!!!!!!!!!

    hi,
    you can my post here http://forum.java.sun.com/thread.jsp?forum=33&thread=302433

  • Data in .jsp or HTML form fields, to a JAVA File and DB

    Hi,
    I am new to the JAX-RS, I have a form where I fill in some details, There is a submit button towards the bottom of that form, when I click submit, it needs to do two actions:
    1) Pass the data in different fields through different variables to into a JAVA file. I am not sure on how to call a JAVA file or program's method from either .HTML or .JSP
    2) Extract the data from the fields and populate a DB through JDBC Connection
    Your help is greatly appreciated!
    Thanks,

    If you're looking for some to write the code for you, you're in the wrong place. If you've tried to write it yourself, but are stuck on an error message, logic issue, or something similar, feel free to ask a question!
    If you submit code, don't forget to use the code tags. If you submit an error message, be sure to copy the entire message and stack trace.

  • Can I upload a php file to my host with an embedded html contact form in Muse for it to work?

    Can I upload a php file to my host with an embedded html contact form in Muse for it to work?

    That would require to know your hosting provider and his requirements. And therein also lies the answer: You cannot blindly design a form in Muse and just hope it will work, you have to know this stuff beforehand and design "to spec".
    Mylenium

  • How to deal with #ifdef in .java files with javadoc tool?

    My .java file included some '#ifdef' & '#endif' sentence. So when I used javadoc tool to generate the .html files, error happened. Can anyone give me some indication how to resolve the problem, provided that the source code can not be changed because it was written by others. Waiting for your reply and thanks in advance!

    Hi, got the same problem, have stuck for all day on this and yield no progress.
    my source code contain
    #ifdef
    and
    #endif
    it is source code (not comment), the only compile with a special preprocessing tool call
    "sjpp.jar".
    I need to generate Javadoc there.
    the error is
    [javadoc] C:\TEMP\cellml_visual_checkout\cellml_api\java\src\org\cellml\CNode.
    java:101: illegal character: \35
    [javadoc] #ifdef JENA
    if I pass in encoding parameter when I do javadoc,
    say, -encoding "PROPROC",
    then there is different error
    [javadoc] Constructing Javadoc information...
    [javadoc] Standard Doclet version 1.5.0
    [javadoc] Building tree for all the packages and classes...
    [javadoc] java.lang.Error
    [javadoc] at sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEn
    coder.java:361)
    [javadoc] at sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.ja
    va:381)
    [javadoc] at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:136)
    [javadoc] at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:146)
    [javadoc] at java.io.OutputStreamWriter.write(OutputStreamWriter.java:204)
    [javadoc] at java.io.PrintWriter.write(PrintWriter.java:384)
    [javadoc] at java.io.PrintWriter.write(PrintWriter.java:401)
    [javadoc] at java.io.PrintWriter.print(PrintWriter.java:532)
    [javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.printLink
    (HtmlDocletWriter.java:1045)
    [javadoc] at com.sun.tools.doclets.formats.html.MethodWriterImpl.printRetu
    rnType(MethodWriterImpl.java:361)
    [javadoc] at com.sun.tools.doclets.formats.html.MethodWriterImpl.writeSign
    ature(MethodWriterImpl.java:148)
    [javadoc] at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder
    .buildSignature(MethodBuilder.java:176)
    [javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
    sorImpl.java:39)
    any help will be appreciated.
    thanks
    Bill

  • A tool for editing javadoc in .java files

    Hi
    i am looking for a tool that can be use for editing the javadoc in the .java files. it should edit constructors, methods and fields.
    if you know such tool please send me a link.
    Regards
    y.l.

    We list some standalone solutions on the Javadoc FAQ.
    (I have not tried any of these)
    http://java.sun.com/j2se/javadoc/faq/index.html#G
    - Utility for writing doc comments: Doc+.
    - Tool that simplifies the process of writing doc comments: DocWiz.
    - Tool for generating formated Javadoc comments: CommentMaster.
    - Tool for editing Javadoc comments using a word processor-like view: XMLmind XML Editor.
    -Doug Kramer
    Javadoc team

  • Embedding HTML in XML CDATA and encoding issues

    Hi all,
    I'm embedding HTML code in a CDATA section. My problem is that, depending on the document, the HTML can be encoded in many formats. I borrowed a piece of code that sniffs that format so i can create String in the "right" encoding (or at least the one that was guessed).
    - If I directly injected those in the CDATA section, i guess they'd be encoded in UTF-8 and some character would be misinterpreted?
    - What if i would transcode the HTML from the sniffed format to utf-8?
    -Are there any issues woth doing this?
    Sorry if this is a dumb question but I'm quite new to that kind of encoding issues.
    BTW i'm using DOM.
    Thanks
    lexo

    I don't know if it's a dumb question. I just don't understand it at all. Encoding issues only arise when you write data from a Java program to an external location, or when you read data from an external location into a Java program. And none of the activities you mentioned there have anything to do with that.
    When you write your XML to an external file, or wherever you write it to, it gets encoded at that moment. The whole thing. Elements, attributes, CDATA sections, the whole thing. Doesn't matter what's in it, the whole thing gets encoded in whatever charset was chosen.
    Does that help?

  • BUG: error rebuilding SQLJ files along other java files with generic

    I have done a rebuild on a package containing some SQLJ files, and (consistently) got the following error:
    C:\TeleMessage\trunk\src\telemessage\db\impl\dbAdmin.sqlj
        Error(44,18): Java Parsing. Encountered: <
        Expected: <IDENTIFIER> ...; "[" ...; The error at the cursor in the given file is not possible, since there was no '<' there, and besides - if I non-aggresively changed the file, e.g. narrowed imports, changed whitespace or added comments - the error remained in the same location.
    I went and done a search using regex in the package, for a line starting with 17 chars followed by a '<'.
    I found it in one of the normal JAVA files (not-SQLJ), at line 44 (surprise!) - in a Java 5 generics declaration, e.g. Map<String,Integer>. the 18th character was indeed the '<'.
    I'm guessing that the SQLJ translator (accidentally?) parses non-SQLJ files.
    If this cannot be fixed, it is really bad - it is one thing that JDeveloper cannot support Java 5 language features because of its dependancy in the SQLJ translator (which is not known to be upgraded until version 11g if at all), but the inability to compile SQLJ files in a project containing other non-SQLJ java files with Java 5 features is hard.
    I could only workaround this by rebuilding SQLJ files one at a time!
    I also have another type of error, when rebuilding the same project in a higher-level pacakge (root or "Application Sources"):
    C:\TeleMessage\trunk\src\dbtools\CallbackNumberFiller.sqlj
        Error(24,8): Missing semicolon.
        Error(24,8): Unbalanced curly braces.Again, the specified file could not be the one to blame - the location of the error is in the middle of the public modified keyword in a method declaration; nothing is neither missing nor unbalanced.
    This appears to be different, as it pops in the log near the end of the build process, when the JSPs are being built, specfically during the time the message log fills with "writing <...>" lines (after "translating <...>" and "compiling <...>".
    I can consistently reproduce both cases - please advise how I can help you find out what causes this.
    Regards,
    Yaniv Kunda

    First of all, this bug not JDeveloper's problem, but the SQLJ team's.
    You can read more posts about this:
    Re: BUG: Cannot translate SQLJ files with Java5 generics code
    Re: How to use SQLJ with Java 1.4 and 1.5?
    Re: SQLJ discontinued??
    And if we're at it, this is strange - I can't seem to find the oracle doc you quoted...
    SQLJ 11g? The latest release is a part of JPublisher 10.2 available from
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    I also didn't find anything on google on 11g, nor about the part number you specified.
    Didn't find any Java 1.5 supporting SQLJ translators from other vendors as well.
    Do you have any link to this statement?
    But if we examine this bug again, the problem involves JDeveloper passing Java 5 featured JAVA files to the SQLJ translator.
    Isn't there a way to instruct the translator to use CLASS files compiled by a normal Java 5 compiler, instead of trying to compile the files itself?
    Regards,
    Yaniv Kunda

Maybe you are looking for

  • Error: Field BNKA-BNKLZ . is not an input field

    Dear Experts, My client following vendor creation process is as follows Requestor logs his request into EP -> it is recorded into MDM -> after approval from central team, it syndicate into SAP -> Idoc entry -> Table entry Now in case of vendor reques

  • How to apply "Custom Layout" to a XSLT + COCOON + APACHE Report

    I've created a new shared Report Layout, the Report Layout Type is "Generic Columns (XSL-FO)" , under " Home > Application Builder > Application 106 > Shared Components > Report Layouts ", this layout just adds the font-style="italic" color="red" att

  • Re: Can I download the recovery disk for my Equium?

    Hi! I got a virus though MSN on my computer and it slowed my computer so I downloaded the free version of avg and done a fast scan to clear the virus out. Then once it had finished it asked me to restart my computer so I did but now everytime I log o

  • How can you restore from both an iCloud backup AND an iTunes backup?

    In article HT5262 (linked below) iOS backups are covered. There is a section "When to use iCloud and iTunes Backup together". I understand how to do this and the reasons why. What I haven't been able to find is an explanation of how you would actuall

  • Iphone contact backups

    After backing up and then updating (iOS 4 to 5) my wife's iPhone in iTunes on her PC (Vista), only about half of her contacts appeared on the phone. Unfortunately, after realizing half the contacts were missing, I synced her iPhone again. Well, this