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

Similar Messages

  • ClassFileTransformer and how to transform the base class first

    Hello,
    I've written a ClassFileTransformer that uses ASM to enhance classes at load time.
    But some of the enhancements depends on possible enhancements to the super class.
    Example: under some coditions a method doWork() is inserted. This method did not exist in any class (doWork is just an example, I use a name that is not accepted by the compiler but allowed by the JLS).
      public class A {}
      public class B extends A {}If the method doWork() was inserted into class A, then the doWork() of B has to call doWork() of class A:
       super.doWork().Currently I try to load the base class by using
       loader.loadClass(superName.replace('/', '.'));this loads the super class but without passing my transformer !
    How can I solve this ?

    Looking at the comments in ClassFileTransformer.java and the code in ClassLoader, it seems the transformers are called only for class files that get a ClassFormatError. Transformers are intended to fix old broken/incompatible class files on the fly.
    I guess the intended way to do what you are doing is to define a custom class loader. Read class into byte[], transform, call defineClass() on the transformed byte[]. Google for java custom class loader for examples.

  • Warning :: Derived class hides the base class virtual function

    We are porting from CC5.3 to CC5.8 compiler with Sun Studio one compiler. After plenty of hurdles we are in the final stage of removing the warning messages... Amoung the plenty the following one is very common and in different files. Why am I getting this error in 5.8 and not in 5.3 compiler....
    Warning: derived_Object::markRead Hides the virtual function base_Object::markRead(ut_SourceCodeLocation&) const in a virtual base
    From this it is easily understandable that the base class mark read was hidden by derived class markRead... when we drive and override the derived class function.... It is all over the place....
    Thank you,
    Saravanan Kannan
    //public: using xx_Object :: markRead;
    virtual void markRead() const;

    The Sun C++ FAQ discusses the warning message:
    http://developers.sun.com/prodtech/cc/documentation/ss11/mr/READMEs/c++_faq.html#Coding1
    Notice that warnings are not necessarily errors. But I applaud your desire to fix the code so that it generates no warnings. I wish more of our customers could be persuaded to do the same. :-)
    C++ 5.3 issues this warning, by the way. Example:
    struct B { virtual int foo(int); };
    struct D : B { virtual int foo(double); }; // line 2
    D d;
    line 2: Warning: D::foo hides the virtual function B::foo(int).
    If for your particular code you do not see a warning with C++ 5.3, it would be due to a bug in C++ 5.3 that was later fixed.

  • Reflection: attributes from the base class

    Is there a way to get the attributes from the base class of a derived class via reflection? I only found methods to get the attributes from the derived class.
    Example:
    class A
    int a = 4;
    class B extends A
    int b = 5;
    Object unknown = new B();
    Code/Idea to get all attributes from baseclass A using unknown (here: a=4)?

    Thank you all for your hints. The mistake I make, was to use the baseclass, and not the derived class for getting the attributes. By using an extra parameter of type class I got all attributes in their context.
       private StringBuffer getDump(Object obj, Class cl)
             dmp.append(cl.getName() + " {\n");
             Field[] attribute = cl.getDeclaredFields();             <--- only the fields of the current class
             for (int j = 0; j < attribute.length; j++)
                attribute[j].setAccessible(true);
                try
                   if (attribute[j].getType().isPrimitive() || attribute[j].getType() == String.class)
                      dmp.append(attribute[j].getName() + "=" + attribute[j].get(obj) + "\n");
                   else
                      if (((attribute[j].getModifiers() & Modifier.STATIC) != Modifier.STATIC) &&
                          (attribute[j].getType().getName().startsWith("java.lang") == false) &&
                          ((attribute[j].getModifiers() & Modifier.FINAL) != Modifier.FINAL))
                         dmp.append(getDump(attribute[j].get(obj), attribute[j].get(obj).getClass())); <- recursive call
                catch (IllegalAccessException ex)
                   ex.printStackTrace();
             dmp.append("}");
          return dmp;
       }

  • Introspector calling the Base Class multiple times

    Hi
    I am having a Java Bean C (which extends B which in turn extends A) ...and each of these Classes have the BeanInfo classes .. ABeanInfo , BBeanInfo , CBeanInfo....
    And i had written my beaninfos such a way that they are optimised by extending the basebeaninfo and calling super.getPropertyDescriptors and adding them to the Descriptoirs of extra methods like
    Class A
    private String name;
    public void getName()
    Class B extends A
    private String city ;
    public void getCity
    class ABeanInfo extends SimpleBeanInfo
    public PropertyDescriptors[] getPropertyDescriptors()
    // Got the property descriptor for name
    // return by forming array
    My Class B bean info will look like this
    class BBeanInfo extends ABeanInfo
    public PropertyDescriptors[] getPropertyDescriptors()
    PropertyDescriptors[] baseDesc = super.getPropertyDescriptors();
    // Get the property descriptor for City
    // Club the base class desc and the new ones added
    // return by forming array
    But when i use Introspector.getBeanInfo(B.class) , the A.getPropertyDescriptors method is getting called twice (One internally by the introspector and the other when my super.get...)
    How can this be avoided ?? Ofcourse after the first time , the introspector is caching the instances of BeanInfos...
    If this is the implicit behaviour , can i change my BeanInfo classses in such a way that it won't get called

    Why is this a problem?

  • 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 ?

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • Class override, how to create the child class and then the base class

    I started to write a program for a smart DMM, the problem is every version of the DMM the company change the communication commend.
    My idea is to write a child class for every DMM version and every SubVI of the child will override the base class SubVI.
    My problem is, i want first to create one child class and after i will see every thing is work,  start to create the base class. that way i will see if am thinking the right way.
    My question is
    How can i create a child class and then create the base class and configure the SubVi of the child class to be Override of the base class?
    I tried to search in the property of the class but i didn't see nothing.
    Thanks
    Solved!
    Go to Solution.

    This can be done and I've done it on occasion.
    You simply create the base class with the dynamic dispatch methods you require (connector panes need to be identical to thos of the child class).
    Then set the inheritance of the class to inherit from this base class.  If your method is defined as a dynamic dispatch method in the parent, you'll most likely now have some errors (unless your child method was already DD in which case you might just be OK already).
    To change the inheritance of a class, right-click the properties of the class in your project and select properties.  I believe the ineritance tree is at the lower end of the properties.  Click on the "change inheritance" (or something similar) to choose the class from which you now wish to inherit.
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • [svn:osmf:] 13027: Fix bug in SerialElement where the durationReached event was dispatched on a child-to-child transition due to the base class thinking that the duration had been reached  (since the second child didn't have a duration yet).

    Revision: 13027
    Revision: 13027
    Author:   [email protected]
    Date:     2009-12-16 18:09:46 -0800 (Wed, 16 Dec 2009)
    Log Message:
    Fix bug in SerialElement where the durationReached event was dispatched on a child-to-child transition due to the base class thinking that the duration had been reached (since the second child didn't have a duration yet).  Injection from trait refactoring.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/composition/CompositeTimeTrait.as

    http://ww2.cs.fsu.edu/~rosentha/linux/2.6.26.5/docs/DocBook/libata/ch07.html#excatATAbusErr wrote:
    ATA bus error means that data corruption occurred during transmission over ATA bus (SATA or PATA). This type of errors can be indicated by
    ICRC or ABRT error as described in the section called “ATA/ATAPI device error (non-NCQ / non-CHECK CONDITION)”.
    Controller-specific error completion with error information indicating transmission error.
    On some controllers, command timeout. In this case, there may be a mechanism to determine that the timeout is due to transmission error.
    Unknown/random errors, timeouts and all sorts of weirdities.
    As described above, transmission errors can cause wide variety of symptoms ranging from device ICRC error to random device lockup, and, for many cases, there is no way to tell if an error condition is due to transmission error or not; therefore, it's necessary to employ some kind of heuristic when dealing with errors and timeouts. For example, encountering repetitive ABRT errors for known supported command is likely to indicate ATA bus error.
    Once it's determined that ATA bus errors have possibly occurred, lowering ATA bus transmission speed is one of actions which may alleviate the problem.
    I'd also add; make sure you have good backups when ATA errors are frequent

  • Weu0092d like to get Custom reports. The base of reports is Security Audit Log

    We’d like to get Custom reports. The base of reports is Security Audit Log files. This is files for SM20.
    What does the file structure look like? What is field of it?
    Thanks!

    Hello Marina
    The data written to the security audit log correspond to the DDIC structures RSLGENTR (up to release 4.6) and RSAUENTR2 (in newer releases). DDIC structures can be viewed using TA SE11 (data type).
    As I can see you have already opened a thread regarding this. Please don't duplicate the threads, as this only widespreads the information.
    Regards,
    Désiré

  • [svn:bz-trunk] 21260: Update the qa-frameworks. zip to remove all comments from the base xml when merging config files.

    Revision: 21260
    Revision: 21260
    Author:   [email protected]
    Date:     2011-05-16 07:46:54 -0700 (Mon, 16 May 2011)
    Log Message:
    Update the qa-frameworks.zip to remove all comments from the base xml when merging config files.
    Modified Paths:
        blazeds/trunk/qa/resources/frameworks/qa-frameworks.zip

    Try options=('!makeflags') in PKGBUILD.

  • Why the constructor of the base class calls first when u run the java app.

    why the constructor of the base class calls first when u run the java application

    For the record the other very exciting questions are:
    pls give the differences between application server and web server with examples
    will u pls narrate the differences between servlet context and servlet config.....
    where can we find servlet config...
    is there any methods to access servlet config

  • [svn:fx-trunk] 9453: Fix ASDoc comments, exclude the LayoutElementHelper class.

    Revision: 9453
    Author:   [email protected]
    Date:     2009-08-21 10:48:14 -0700 (Fri, 21 Aug 2009)
    Log Message:
    Fix ASDoc comments, exclude the LayoutElementHelper class.
    QE notes: None
    Doc notes: None
    Bugs: None
    Reviewer: Hans
    Tests run: N/A
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHe lper.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicEleme nt.as

  • [svn:osmf:] 11117: Fix inconsistency in NetStreamSwitchableTrait' s storage of currentIndex (now it's consistently on the base class).

    Revision: 11117
    Author:   [email protected]
    Date:     2009-10-23 16:33:31 -0700 (Fri, 23 Oct 2009)
    Log Message:
    Fix inconsistency in NetStreamSwitchableTrait's storage of currentIndex (now it's consistently on the base class).  Disable one specific unit test which is related to MockNetStream.  (Note that this unit test works when running against the network.)  Will fix later.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/net/dynamicstreaming/NetStreamSwitchableTrai t.as
        osmf/trunk/framework/MediaFramework/org/osmf/traits/SwitchableTrait.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/MediaFrameworkTests.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/media/TestMediaPlayer.as

    Also, just to note, I am  only interested in VPAID Linear ad's working, Non-linears are for another day 

  • Any way to get schema comments into the generated files?

    Hi there,
    I have a schema that in part looks like this:
    <xsd:complexType name="LinkType">
    <xsd:annotation><xsd:documentation>
    A link joins two distinct primary entities to each other. There is no provision
    for more than two primary entities participating in a link.
    Entity can have only one link per "right" entity.
    @ejb.bean name="EntitiesLink"
    </xsd:documentation></xsd:annotation>
    <xsd:sequence>
    </xsd:sequence>
    </xsd:complexType>
    I would like the comments to be passed through. So I would like to have a comment block that looks like:
    * A link joins two distinct primary entities to each other. There is no provision
    * for more than two primary entities participating in a link.
    * Entity can have only one link per "right" entity.
    * <p>The following schema fragment specifies the expected content contained within this java content object.
    * <p>
    * <pre>
    * <complexType name="LinkType">
    * <complexContent>
    * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * (The rest of the auto generated comment about the schema that jaxb currently generates.)
    * </pre>
    * @ejb.bean name="EntitiesLink"
    */

    The problem with this is that the @tags appear at the top of the comment, which is of course not legal.
    So this:
    <xsd:appinfo>
    <jaxb:class>
    <jaxb:javadoc>
    @ejb.bean name="EntitiesLink"
    </jaxb:javadoc>
    </jaxb:class>
    </xsd:appinfo>
    ends up looking like this:
    * @ejb.bean name="EntitiesLink"
    * Java content class for LinkType complex type.
    * <p>The following schema fragment specifies the expected content contained within this java content object.
    * <p>
    * <pre>
    * <complexType name="LinkType">
    * <complexContent>
    * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * <sequence>
    * <element name="Id" type="{http://www.sworddance.com/RelationshipBook}FullIdType"/>
    * <element name="Description" type="{http://www.sworddance.com/RelationshipBook}DescriptionType"/>
    * <element name="Left" type="{http://www.sworddance.com/RelationshipBook}LinkEndpointType" minOccurs="0"/>
    * <element name="Right" type="{http://www.sworddance.com/RelationshipBook}LinkEndpointType"/>
    * <element name="LinkInitiateDate" type="{http://www.sworddance.com/RelationshipBook}DateRefType" minOccurs="0"/>
    * <element name="LinkTerminateDate" type="{http://www.sworddance.com/RelationshipBook}DateRefType" minOccurs="0"/>
    * <element name="LinkAwarenessDate" type="{http://www.sworddance.com/RelationshipBook}DateRefType"/>
    * <element name="CommonOpinion" type="{http://www.sworddance.com/RelationshipBook}OpinionType" minOccurs="0"/>
    * <element name="Secondary" type="{http://www.sworddance.com/RelationshipBook}LinkEndpointType" maxOccurs="unbounded" minOccurs="0"/>
    * <element name="RootLinkId" type="{http://www.sworddance.com/RelationshipBook}LocalIdType" maxOccurs="unbounded" minOccurs="0"/>
    * <element name="Properties" type="{http://www.sworddance.com/RelationshipBook}PropertiesType" minOccurs="0"/>
    * <element name="Locations" type="{http://www.sworddance.com/RelationshipBook}LocationCollectionType" minOccurs="0"/>
    * <element name="Encounter" type="{http://www.sworddance.com/RelationshipBook}EncounterType" maxOccurs="unbounded" minOccurs="0"/>
    * </sequence>
    * <attribute name="directional" type="{http://www.sworddance.com/RelationshipBook}DirectionalType" />
    * <attribute name="LinkSourceId" type="{http://www.sworddance.com/RelationshipBook}LocalIdType" />
    * <attribute name="implicit" type="{http://www.w3.org/2001/XMLSchema}boolean" />
    * <attribute name="family" type="{http://www.w3.org/2001/XMLSchema}boolean" />
    * <attribute name="LinkOwnerId" type="{http://www.sworddance.com/RelationshipBook}LocalIdType" />
    * <attribute name="isKnown" type="{http://www.w3.org/2001/XMLSchema}boolean" />
    * <attribute name="confidence" type="{http://www.sworddance.com/RelationshipBook}PercentRangeType" />
    * </restriction>
    * </complexContent>
    * </complexType>
    * </pre>

Maybe you are looking for

  • ITunes is unable to connect the server " iTunes não conecta com o servidor"

    Microsoft Windows 7 x64 Ultimate Edition Service Pack 1 (Build 7601) Sony Corporation VPCEH30EB iTunes 10.6.1.7 O QuickTime não está disponível FairPlay 1.14.37 Apple Application Support 2.1.7 Biblioteca do Atualizador do iPod 10.0d2 CD Driver 2.2.0.

  • Error in Crystal Report 2008 SP1

    Hi, I created a parmeterized sql command template(.rpt) example: SQL  'SELECT Name FROM Employee WHERE EmployeeID = {?EmpID}' in the template command with parameter as EmpID. We are generating the report Using RAS 2008 sp1. and getting the below erro

  • ISE max-login-ignore-identity-response

    Hi forumers' Greeting, I had a question regarding ISE login identity response. In my POC deployment, i'm using a single testing domain user account at the testing Active Directory. I able to login to the testing's secure network using the same user c

  • "List Data Sets" don't work

    Hi all I created the VI with SVE. The data I can write and read. But the List Data Sets.vi don' show out data. Why? Respect. Iskander Attachments: Test_DSC.vi ‏11 KB

  • My Sent mail Notification no longer plays. How do I get it back?

    The Sent mail Sound is no longer working. Is there a known issue with this or how can I get it back?