By default, NetBeans generates @author documentation tags in the comments section for Interfaces, classes, and abstract classes.
For example, Created a Java class as given below
/**
*
* @author authorname
*/
public class HelloWorld {
private String name;
public static void main(String[] args) {
System.out.println("Hello world in Netbeans IDE");
}
}
if you have an existing project and want to change @author, you have to search for @author and replace its value.
if you want to change the @author value for new classes and interfaces in NetBeans, You have to change the NetBeans author template.
The @author
tag is a java documentation tag that describes an author of a java code file.
This tutorial explains How to change the Netbeans @author tag template.
Netbeans author tag template
Netbeans provides the template configuration that stores in the user.properties file. You have to change the @author template.
Following are steps
- Open javaprojects in Netbeans IDE
- Select
Tools
Menu +Templates
Menu Item - It shows the
Template Manager
Popup window - Select the
Settings
Button - It opens the template file user.properties editor
- This file content follows the content
# uncomment the next line and specify your user name to be used in new templates
#user=Your Name <your.name at your.org>
uncomment the line that contains #user
by removing # at the start.
Change user value to new value.
# uncomment the next line and specify your user name to be used in new templates
user=Firstname Lastname
save it and close the file.
Next, It creates new classes or interfaces as given below.
/**
*
* @author Firstname Lastname
*/
public class HelloWorld {
private String name;
public static void main(String[] args) {
System.out.println("Hello world in Netbeans IDE");
}
}
This change applies to a single project.