Setting a coding convention in eclipse that throws an error if coding rules are not followed

I am trying to set up a legend for eclipse. I want to establish agreements in such a way that at the first stage public participants come, then defended, default and finally private. How do I do it with eclipse. I tried to customize it using settings -> formatter-> code-style. But I couldn't find anything similar to sequencing the appearance of public protected and private members. Compile time errors should show up in case of violation. Is there a way to do this in eclipse or using any plugin?

+3


source to share


1 answer


Compile time errors should show up in case of violation.

You cannot display compilation errors.
The only errors you can set in Eclipse preferences are those listed in the documentation

To set up the legend for Eclipse:

Open "Source" β†’ "Sort Members"

In the dialog box, select Participant Sort Order.



Select "Member sort order" from the dialog box

Set the sort order you want based on member visibility (public, private, protected, default)

enter image description here

Link:

+2


source







All Articles