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

Often many getters and setters are created in the Java class. In many circumstances, we really do not need them, but they need to be created due to the requirements of the used Framework (for example, in a JSF-controlled bean).

The NetBeans Navigator window seems cluttered with these getters and setters and makes it difficult to find methods that we really need to work with.

Is there a way to make these getters and setters removed from the NetBeans Navigator window?

Navigator window

+4
source share
1 answer

I often create a "template" superclass for such garbage (at least until Lombok, when I can use Lombok). These methods are still available by looking at inherited properties.

However, a class with so many properties can be called up by some kind of refactoring, depending on your actual needs - this is a lot to keep track of.

(You can also filter the list, but this is dangerous because if you hide, say, get* , you can remove real methods from the view.)

+1
source

Source: https://habr.com/ru/post/1379315/


All Articles