MonoThreaded
MonoThreaded

Reputation: 12043

Javadoc @see object method

I would like to link a method of another object using @see from a comment block
@see is only giving me the option to link classes, not methods.

What is the hack?

public class A {
  B bee;

  /**
   * Just invoking methodB on bee.
   * @see B.methodB() <-- There
   */
  public methodA() {
     bee.methodB();
  }
}

public class B {
  /**
   * The real stuff
   */
  public methodB() {
    // real stuff
  }
}

Upvotes: 50

Views: 49771

Answers (3)

Curious
Curious

Reputation: 2971

You need to use # instead of .

@see B#methodB()

See the documentation for @see here.

Upvotes: 17

Grim
Grim

Reputation: 1986

This applies to javadocs in Eclipse.

Press # and Ctrl+Space to get a "link" to a Member-Method of current context.

In a Javadoc press

SDFCtrl+Space#gDFS Ctrl+SpaceSpaceSymbol

to create the link:

{@link SimpleDateFormat#getDateFormatSymbols() Symbol}

Upvotes: 7

Miquel
Miquel

Reputation: 15675

Use hashes instead of dots, as in: @see B#methodB()

Upvotes: 91

Related Questions