Is there a reason to include both @version and @since
as part of a class?
They seem to be mutually exclusive.
Also, what does %I% and %G%
mean, and how to set/use them?
@version %I%, %G%
thanks
Is there a reason to include both @version and @since
as part of a class?
They seem to be mutually exclusive.
Also, what does %I% and %G%
mean, and how to set/use them?
@version %I%, %G%
thanks
I don't see how they are mutually exclusive. One is used to define version, and the other is used for describing since when the method is there. For example:
/**
* Does Whatever
* @version 1.2.3
* @since January 8, 2005
*
*/
public void myMethod() {
// .......
}
Regarding the characters you mentioned, they seem proprietary, and in any case I have no clue what they mean.
The @version tag should be the current version of the release or file in question. The %I%, %G% syntax are macros that the source control software would replace with the current version of the file and the date when the file is checked out.
The @since tag should be used to define which version you added the method, class, etc. This is your hint to other developers that they should only expect the method when they run against a particular version of the package. I would consider these uber-important parts of the documentation if you're shipping your code as a library intended for someone else to use.