2

I am developing a library which is used for some specific validation operations. Every thing is ok for me in usage, but when I publish it, every time developers need to read manual document.

So, I want to show usage tips like shown blow.

enter image description here

How can i do it ?

0

3 Answers 3

3

You need to write JavaDoc comments in your code and then you can generate JavaDoc html.

JavaDoc comments are special comments which are between /** and */ and can be used to generate JavaDoc. e.g.

/**
 * Class description.
 * <p>
 * Some more details
 * 
 * @author Edd
 */
public class MyClass {

    /**
     * Method description.
     * 
     * @param param
     *            important parameter
     */
    public static void myMethod(String param) {

    }
}

This would then look like this as a tooltip:

JavaDoc tooltip

When you release your library for other developers to use, you would typically release it as a jar file. When you package up your jar you should also generate a javadoc.jar file to accompany your jar. This can then be used by other developers to get the usage tips.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, but unless the JavaDoc is packages with the library, it will not be visible to a programmer using the library.
@Tichodroma I've added a brief note on generating javadoc.jar files in response to your comment
1

Write JavaDoc comments and publish them together with your library.

If you are using Maven, you can use the javadoc:jar goal of the Maven Javadoc Plugin.

Comments

1

Read about and use javadoc, here: http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.