![]() ![]() The second step, which I haven't done yet, is creating a PMD rule to enforce this with maven (or any other build tool for that matter) and also be able to see violations of the rule in my IDE with the pmd plugin. Then I can use this annotation in any Kotlin project. * Whenever a Kotlin class or method is intended to be accesible at package level only. * Use in Kotlin code for documentation purposes. So even if it's possible to access package-private classes and methods in Java, I still choose to use the package modifier.įor this I created a project with a single annotation: package I want to know what public interface some package is presenting to the rest of the project, hide factory implementation classes and so on. As points out, you can use the internal keyword in a module or you can put all classes that would otherwise belong in a package inside a single file, but sticking several classes in a file may be a questionable design decision.įor me, the package visibility is helpful for its documenting value.
0 Comments
Leave a Reply. |