Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of getters and setters from the Netbeans Navigator window

It is not uncommon to create many getters and setters in a Java class. In many of the circumstances, we don't really need them but have to create them due to the requirement of the Framework that we use (say for example in JSF managed bean).

The Netbeans Navigator window seems cluttered with these getters and setters and make it difficult to look for the methods we really have to work with.

Is there any way to make these getters and setters away from Netbeans Navigator window?

Navigator window

like image 917
siva636 Avatar asked Nov 14 '22 15:11

siva636


1 Answers

I often create a "boilerplate" superclass for junk like that (at least before Lombok, when I'm able to use Lombok). The methods are still accessible by viewing inherited properties.

That said, a class with this many properties might be due for some refactoring, depending on your actual needs--that's a lot to keep track of.

(You may also be able to filter the list, but that's risky, because if you hide, say, get* you might remove real methods from view.)

like image 83
Dave Newton Avatar answered Jan 25 '23 23:01

Dave Newton