JavadocMethod checks for @see annotations

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JavadocMethod checks for @see annotations

Stephen Gaffigan
Hello,

I've recently begun using checkstyle to check Javadoc compliance in my Java projects.  I use it through ant as well as through the eclipse-cs plugin.  I've found it very easy to install and get configured, and it's a great replacement for the previous tool I used for this purpose (Sun DocCheck).

I'm looking for a JavadocMethod check that checks for @see annotations in get and set access methods.  For example, I'd want errors/warnings if either of the @see annotations were missing in the below code.  Is this possible with checkstyle?  Does it require that I write a custom check?

/**
  * Get access method for foo.
  * @return Foo
  * @see #setFoo(Foo)
  */
public Foo getFoo() {
   return this.foo;
}

/**
  * Set access method for foo.
  * @param foo Value to set
  * @see #getFoo()
  */
public void setFoo(Foo foo) {
   this.foo = foo;
}

Thanks for the great tool.

Steve


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: JavadocMethod checks for @see annotations

Oliver Burn
Glad you like the tool.

I believe you will need a custom check to implement the behaviour you are seeking.

It should be easy to copy/modify the existing check.

On Wed, Nov 23, 2011 at 05:19, Stephen Gaffigan <[hidden email]> wrote:
Hello,

I've recently begun using checkstyle to check Javadoc compliance in my Java projects.  I use it through ant as well as through the eclipse-cs plugin.  I've found it very easy to install and get configured, and it's a great replacement for the previous tool I used for this purpose (Sun DocCheck).

I'm looking for a JavadocMethod check that checks for @see annotations in get and set access methods.  For example, I'd want errors/warnings if either of the @see annotations were missing in the below code.  Is this possible with checkstyle?  Does it require that I write a custom check?

/**
  * Get access method for foo.
  * @return Foo
  * @see #setFoo(Foo)
  */
public Foo getFoo() {
   return this.foo;
}

/**
  * Set access method for foo.
  * @param foo Value to set
  * @see #getFoo()
  */
public void setFoo(Foo foo) {
   this.foo = foo;
}

Thanks for the great tool.

Steve


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user