Sample Javadoc comments for classes or methods using generics?

Can anyone show me a sample Javadoc comment for a class or a method that uses generics. All my attempts so far ended up in warnings from the Javadoc tool..
I also looked in the Sun forums, in the Javadoc documentation, but nowhere could I find anything that would help me write correct javadoc comments.
Any luck for you guys?
Thanks a lot,
-Laurent

Thanks man, sorry it must seem obvious to you, but
for some reason I couldn't get it to work.No. The first time I also had to ask.
Now an even more difficult (for me) question: how
would you refer to that method in a @see or {@link
..} javadoc comment?Manually erase the method:
* The see tag refers to this method
* @param <T> a type variable
* @see #foo(Object)
<T> void foo(T t) {}

Similar Messages

  • Javadoc comments for classes included in the sdk

    My question is pretty simple: For any class that I come across in the online java documention provided on this site, can I assume if the javadoc page does not include a @since tag, that it has been there since java 1.0?
    Specifically, I'm wondering about java.text.ChoiceFormat
    Thanks

    API of package java.text:
    Since: JDK1.1
    I guess this includes ChoiceFormat.

  • Get javadoc comment for concrete methods

    Hi all,
    How to get javadoc comments to our concrete methods same as default methods.suppose if i generate action class, action method will generate with parameters and for this total java doc comments with method descritption generated whenver i choose yello bulb(at left indent) ---> Add missing java doc.
    So this type of facility i want to add to my own method .How can i do ?

    Hi all,
    How to get javadoc comments to our concrete methods same as default methods.suppose if i generate action class, action method will generate with parameters and for this total java doc comments with method descritption generated whenver i choose yello bulb(at left indent) ---> Add missing java doc.
    So this type of facility i want to add to my own method .How can i do ?

  • Keep javadoc comments in class files

    Hi there,
    is there a way to keep javadoc comments in classfiles?
    Reason: Not any company can spread the source for their algorithms, but as customer requests grow to use it with eclipse, code completion and javadoc, there is a need for such "feature".
    Any ideas? Not documented tricks?
    Ty

    Ty, for you reply - this in response ... maybe you can support it ;-)
    Your report has been assigned an internal review ID of 719676,
    which is NOT visible on the Sun Developer Network (SDN).

  • Trace all classes and methods used

    I have a java application that uses a third party API jar file. I call methods on classes in this API. I need a application/API that will enable me dyamically (or possibly statically) to determine every single method in every class used that my application uses. If for example, my application uses a method on a class Stock : Stock.lookup("abc") and in turn lookup() calls a method in Stock2 and that method calls a method in Stock3. I need a way to to know the whole list of all methods in classes used for each method in my class.
    Please let me know if you know any such Application/API that does this.
    Ahmed

    The java -verbose:class output was useful, but I need an API/Application that will show me clearly which mehod each mehod invokes and in which class; method by method e.g:
    method foo1(String s) in class ABC.java line 19
    invokes foo2() in class ABC2.java line 3224
    invokes foo3() in class ABC3.java line 1556
    Ahmed

  • Bug: JVMTI's NativeMethodBind never called for Class.getSuperclass() method

    This issue is specific to the JRockit JVM only, since it doesnt occur in the HotSpotVM.
    The JRockit JVM version is:
    jrockit-jdk1.6.0_29-R28.2.0-4.1.0
    I am using the JVMTI's NativeMethodBind function to instrument the getSuperClass() method.
    However, it seems all the other native methods of java.lang.Class are indeed passed through the NativeMethodBind event, except for getSuperClass().
    Here is a bit of code:
    void JNICALL
    NativeMethodBind(jvmtiEnv *jvmti_env,
                        JNIEnv* jni_env,
                        jthread thread,
                        jmethodID method,
                        void* address,
                        void** new_address_ptr)
         jvmtiPhase phase;
         jvmtiError status=jvmti_env->GetPhase(&phase);
         if((phase==JVMTI_PHASE_PRIMORDIAL) || (phase== JVMTI_PHASE_ONLOAD))
    //store method info in vectors
              nativeMethodIdVector.push_back(method);
              nativeMethodAddressVector.push_back(address);
              return;
         if(!nativeBound)
              if(!checkedNativeList)
                   checkedNativeList= true;
                   if(doCheckNativeList(jvmti_env))
                        nativeBound = true;
                        return;
              char * name;
              char* sig;
              char* genericP;
              jvmtiError status= jvmti_env->GetMethodName(method,&name,&sig,&genericP);
              const char* a = name;
              printf("%s\n",a);
    bool doCheckNativeList(jvmtiEnv *jvmti_env)
         bool foundSuperClassMethod = false;
         for(std::vector<int>::size_type i = 0; i != nativeMethodIdVector.size(); i++)
              jmethodID currentmethodid= nativeMethodIdVector;
              void* currentmethodAddress= nativeMethodAddressVector[i];
              char * name;
              char* sig;
              char* genericP;
              jvmti_env->GetMethodName(currentmethodid,&name,&sig,&genericP);
              const char* a = name;
              printf("%s\n",a);
         return foundSuperClassMethod;
    The output of this is the following. Note that even though methods like Class.forName0() are included, getSuperclass() is not
    debuggerEvent
    enterExceptionHandler
    generateVirtualCode
    generateFixedCode
    throwPendingType
    registerNatives
    initializeClass
    fillInStackTrace0
    registerNatives
    currentTimeMillis
    nanoTime
    registerNatives
    start0
    stop0
    isAlive
    suspend0
    resume0
    setPriority0
    yield
    sleep
    currentThread
    countStackFrames
    interrupt0
    isInterrupted
    holdsLock
    getThreads
    dumpThreads
    registerNatives
    getName0
    getInterfaces
    getSigners
    setSigners
    getModifiers
    getDeclaredFields0
    getDeclaredMethods0
    getDeclaredConstructors0
    getProtectionDomain0
    setProtectionDomain0
    getDeclaredClasses0
    getDeclaringClass
    getGenericSignature
    getRawAnnotations
    getConstantPool
    desiredAssertionStatus0
    getEnclosingMethod0
    getPrimitiveClass
    getStackAccessControlContext
    getCallerClass
    initProperties
    initialize
    getFileSystem
    initIDs
    initIDs
    registerNatives
    retrieveDirectives
    getPrimitiveHashCode0
    forName0
    intern0
    getFieldOffset
    getBooleanAttributes
    mapLibraryName
    canonicalize0
    registerFinalizer
    load
    initIDs
    initIDs
    set
    initIDs
    allocLargeObjectOrArray
    setIn0
    invokeMethod
    setOut0
    setErr0
    findSignal
    handle0
    setErrorMode
    open
    readBytesPinned
    available
    isJDK15OrBetter
    getNewTla
    initNative
    close0
    list
    canonicalizeWithPrefix0
    getFinalizeeArraySize
    waitForFinalizees
    waitForActivatedQueue
    findLoadedClass0
    isRetransformClassesSupported0
    availableProcessors
    delete0
    VMSupportsCS8
    checkIfThreadOwnsLock
    convertThinLockedToFatLocked
    waitForNotifySignal
    throwException
    clone0
    find
    getVersion0
    initOptionalSupportFields
    getStartupTime
    getVmArguments0
    maxMemory
    getSystemTimeZoneID
    getLength
    getClassContext
    initIDs
    open
    length
    seek
    writeBytesPinned
    initIDs
    initIDs
    initIDs
    initIDs
    read0
    read1
    pread0
    pread1
    readv0
    write0
    write1
    pwrite0
    pwrite1
    writev0
    preClose0
    close0
    force0
    close0
    checkAndTransferLazyLocked
    checkAndTransferLazyLocked
    finalize
    getUTF8At0
    getIntAt0
    defineClass0
    runClinit
    initIDs
    init
    deflateBytes
    defineClass0
    end
    init
    inflateFast
    latestUserDefinedLoader
    end
    park0
    park0
    park0
    park0
    setHasRetransformableTransformers
    getAllLoadedClasses0
    retransformClasses0
    unpark0
    yield
    sleep
    options
    init
    classID
    stackTraceID
    threadID
    rotate
    shutdown
    start
    stop
    onCloneRecording
    onStartRecording
    onStopRecording
    add
    remove
    buffer
    flush
    write
    setEnabled
    setThreshold
    setPeriod
    getPeriod
    descriptors
    addConstPool
    removeConstPool
    storeConstPool
    getSystemPackage0
    defineClass1
    hasStaticInitializer
    d2i
    open
    close0
    Edited by: user11362013 on Jan 11, 2012 4:56 PM
    Edited by: user11362013 on Jan 11, 2012 4:57 PM
    Edited by: user11362013 on Jan 11, 2012 4:58 PM

    Can somebody please look at this. The formatting options in the forum dont seem to support code styles.
    I am willing to provide more samples or a full on reproducible code zip if somebody is willing to take a look at this.
    This issue is really hampering our development.

  • Authentication syntax for HTTP GET method using TCP functions in Labview on linux

    Hi,
    Currently, I am trying to communicate to web server. I have Labview installed on a Linux machine. The HTTP function blocks and other labview functions do not work. Hence, I am building a HTTP code string using TCP functions (port 80) to talk to the web server. I am successfully able to fetch a response from web sites (example www.ni.com) from my vi. However, when I try to communicate to my web server, it does not work. It requires an authentication. I am able to open http://ipaddress in my browser from my machine using username and password. Can someone help with Authentication string requirement for GET method?
    so far the string is:
    GET /index/ HTTP/1.1
    Host: http://xx.xx.xx.xx

    An easy option would be to try http://userassword@server syntax for the URL.
    Else I posted a Twitter fetcher once (won't work anymore since Twitter moved to Oauth authentication) at LAVA. Based on code from @cloew.
    The code is part of this LLB.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Searching for class or method to add mobile components programatically

    Hello,
    I'm searching for a class and/or a method to add a mobile component and version to a mobile device programatically.
    Furthermore I would like to know in which datbase-table I can find
    a) The roles and their mobile components
    b) The installed components of the registered devices.
    I Hope you can help me with this issue.
    Best regards.
    Lars

    Hello,
    thanks for your responses. I think the answer of Shobha is very good. I've found a second solution for this problem.
    1. Set the MCD-Attributes
    DATA: mcd_name TYPE SMMW_MCDNAME,
                mcd_ver    TYPE SMMW_MCDVERSION.
        CLEAR mcd.
                 mcd-MCDNAME = mcd_name.
                 mcd-VERSION   = mcd_ver.
                 APPEND mcd TO mcds.
        CLEAR mcd.
    2. Call method
    CALL METHOD CL_SMMW_DEV_ADM=>ASSIGN_MCD_TO_DEVICE
        EXPORTING
          RECEIVERID                                 = 'Your receiver-ID'
          MCDS                                           = mcds
          AUTO_FLAG                                = 'X'
        INVOKE_RULE_EVALUATION     = 'X'
        IMPORTING
          NON_AVAIL                                 = NON_AVAIL
          FAILED_MCDS                              = FAILED_MCDS
          MESSAGE_RETURN                     = MESSAGE_RETURN
        EXCEPTIONS
          MCDNAME_VERSION_INCOMPLETE = 1
          others                                                = 2.
      IF SY-SUBRC <> 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    With the method of class CL_SMMW_DEV_ADM you can easily add MCDs to your device.
    Thank you for your help.
    Best regards.
    Lars

  • TABLE for Class the methods

    Hi ALL,
    Can anyone tell me the DB table where all the Classs and its methods are stored..?
    Also if one could tell me that for any enhancement class implementation where are the OVERWRITE exit methods stored..
    Regards
    Rajivb Kanoria

    Hi Ill give u the complete steps for what im looking for...
    Go to sfw1(switch transaction).
    enter a switch like  MILL_EHP_01A and execute.
    A new transaction in which we get the package for the switch.
    double click on the package name 'MILL_EHP_01A_SWITCH'.
    traverse to Utilities->display_object list.
    u will go to package builder.
    click on dropdown 'enhancement' on the browser window,
    click on 'Enhancement implementations' dropdown.U will get all the implementations name.
    Double click on any one.
    Now in the Right side u will see a class name on the button in the attributes tab.
    click on the overwrite methods tab.
    U will see the overwrite method dere( I want the tables where these methods are stored).
    Click on the button with the class name.GO TO METHODS TAB.
    u will reach the class builder.
    There is a overwrite-EXIT column.
    In that some methods will have a botton for overwrite exit , some will not.
    Where this info is stored about Overwrite Exits./?
    Regards
    Rajiv Kanoria

  • Class implementing interface using generics

    I have an interface that looks like this:
    public interface BinaryTree<T extends Comparable<? super T>> {
         public enum TraverseOrder { PREORDER, INORDER, POSTORDER }
         public boolean isEmpty();
         public boolean search(T key);
         public void remove ( T key ) throws TreeException;
         public void insert(T key) throws TreeException;
         public void print ( TraverseOrder order);
         public int getSize();
    }My shell class that implements it looks like this:
    public interface BinaryTree<T extends Comparable<? super T>> {
         public enum TraverseOrder { PREORDER, INORDER, POSTORDER }
         public boolean isEmpty(){
                      return true;
         public boolean search(T key) {
                      return true;
         public void remove ( T key ) throws TreeException {
         public void insert(T key) throws TreeException {
         public void print ( TraverseOrder order) {
         public int getSize() {
                        return 0;
    }Im getting 2 errors one being
    BST.java:1: > expected
    public class BST implements BinaryTree<T extends Comparable<? super T>> {
    and the other is an enum error. Im pretty sure the second enum error will be resolved by fixing the first error. Any help is apreciated. Thanks
    BLADE

    Yeah tottaly right but the code i posted is wrong sorry lets try one more time
    public interface BinaryTree<T extends Comparable><? super T>> {
         public enum TraverseOrder { PREORDER, INORDER, POSTORDER }
         public boolean isEmpty();
         public boolean search(T key);
         public void remove ( T key ) throws TreeException;
         public void insert(T key) throws TreeException;
         public void print ( TraverseOrder order);
         public int getSize();
    public class BST implements BinaryTree<T extends Comparable><? super T>> {
         public enum TraverseOrder { PREORDER, INORDER, POSTORDER }
         public boolean isEmpty(){
                      return true;
         public boolean search(T key) {
                      return true;
         public void remove ( T key ) throws TreeException {
         public void insert(T key) throws TreeException {
         public void print ( TraverseOrder order) {
         public int getSize() {
                        return 0;
    }

  • Getting javadoc comments of the base class

    Hi,
    I have a class Foo1, and a class Foo2 which extends Foo1.
    All the method are implemented in Foo1, Foo2 simply extends this class and does not override any of the methods. Is it possible that I could get the javadoc comments for all the methods in Foo2. I have a requirement to do this.
    Please let me know, how we can achieve this.
    Thanks.

    Hi,
    Yes, you can easily do this by writing a doclet. Read the documentation at:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/index.html
    This will teach you how to write a doclet:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/overview.html
    The API you should learn is:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/doclet/index.html
    If you have a ClassDoc representing Foo2, you can get all the methods comments by calling ClassDoc.superClass().methods(). That would return you all the methods in Foo1, which have the method comments you want since they are inherited by Foo2.
    -Jamie

  • Where can I find the javadoc api for JavaConcurrentProgram related classes

    Hello,
    I am new to Oracle EBS. I want to use Java Concurrent Program. I found a few links how to write the program. But I could not find the java doc for the classes that are used, for example, JavaConcurrentProgram, CpContext etc. Would someone please tell me where I can find the javadoc api for those classes? And also where do the corresponding jar file/files reside on the server?
    thanks.

    Hello, Ajay,
    I read both of metalinks before. One is example and the other is FAQ. None of them have link to the javadoc api for the JavaConcurrentProgram related classes. I am looking for the javadoc api for the classes related to the java concurrent program. I did find some javadoc api for class like oracle.apps.fnd.common.Context from jdeveloper. But I could not find any javadoc api for oracle.apps.fnd.cp.request.* and oracle.app.fnd.util.* etc.

  • Table name for list of methods for given class

    Hi Experts,
      Is there any table where I can get list of methods in the class?
    Req: Input parameter: Class Name
            Output: List of all methods in it
    Note: As we know, we will have different program names and method names for Classes and Methods. I am okay if I can find table which contains method programs for given class program name.
    Regards,
    Naveen Inuganti

    Hi,
    Check table TMDIR.
    Thanks,
    Venkatesh

  • Comment for a particular cell in the report using WAD

    Can some one help me how to write the comment for a particular cell using WAD which will be published on to the portal

    Hi Pavan,
    In order to modify particular cells in WAD you would need to use the table interface. Refer to this document:
    https://websmp104.sap-ag.de/~sapdownload/011000358700000305572005E/HowToTableInterface.pdf
    Hope it helps,
    Regards,
    Nikhil

  • Opinions on javadoc and wrapper classes

    I have several wrapper classes (in this case, wrappers for InputStream) that override all of the methods, but only a few of the methods overridden have important changes. The rest of the methods behave as described in the original contract (in this case, the various InputStream.read() methods).
    I would like to hear some opinions regarding documenting these methods. Any javadoc I write for them would be nearly identical or even copy/pasted from the original javadoc. The javadoc comment for the whole class clearly says that the class follows the contract for the wrapped class, and as such the overrideen methods will work as such.
    Is it reasonable to ask that someone reading the javadoc for this class should refer back to the wrapped class' API documentation, or should I copy (or paraphrase) the description from the original API documentation?

    I like the idea of @see, but since I'm just javadoc'ing my classes, @see doesn't link, which in this case, eliminates some of the usefulness. Here's a concrete example:
    /* ************ Normal ************ */
    available
    public int available()
    throws java.io.IOException
    Overrides:
    available in class java.io.InputStream
    Throws:
    java.io.IOException
    /* ************ @see ************ */
    available
    public int available()
    throws java.io.IOException
    Overrides:
    available in class java.io.InputStream
    Throws:
    java.io.IOException
    See Also:
    InputStream.available()
    /* ************ JDK in sourcepath ************ */
    available
    public int available()
    throws java.io.IOException
    Description copied from class: java.io.InputStream
    Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. The next invocation might be the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes.
    Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream.
    A subclass' implementation of this method may choose to throw an IOException if this input stream has been closed by invoking the InputStream.close() method.
    The available method for class InputStream always returns 0.
    This method should be overridden by subclasses.
    Overrides:
    available in class java.io.InputStream
    Returns:
    an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking or 0 when it reaches the end of the input stream.
    Throws:
    IOException - if an I/O error occurs.
    /* ********************* end javadoc stuff *************** */
    Because of the Overrides bit, the @see tag isn't really adding anything new. The inherited comment is clearly labeled as such, which is a big plus to me (give credit where credit is due).

Maybe you are looking for

  • How do I move my documents from word to a PDF ?

    How do I change my existing documents to a PDF ?

  • Urgent HELP! need for my Zen touch (20

    Right here we go. I bought my zen touch online last year from a well known supplier. Absolutly brilliant mp3 plaey and happy with the value for money i got. The player did freee alot since i got it at inappropiate times eg. When i was on holiday and

  • HT204389 Siri won't help me call my friends or family

    When I try using siri to call my friends or family, it says that it is not permitted to do so. What should I do? I mean, it worked fine until few days ago.

  • Get to know which one is active Stroke or Fill for the document.

    Is there any way to find out which one, between stroke or fill, is active for a particular document using illustrator scripting? I have to apply color on the selected object accordingly. If fill is active then i use obj.fill.color = 0xff00ff; and, if

  • Crashes on loading, will not open

    Process:         iPhoto [3750] Path:            /Applications/iPhoto.app/Contents/MacOS/iPhoto Identifier:      com.apple.iPhoto Version:         9.5.1 (902.17) Build Info:      iPhotoProject-902017000000000~3 App Item ID:     408981381 App External