![]() This is the annotation syntax typically used to flag experimental features in an API. There no is full Kotlin support in pmd at this moment but it seems to be expected at some point.Ī near-replacement for package private visibility is available using the opt-in requirements feature (credit to pdvrieze on Kotlin discussions). 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. So, you can think of a module as a set of Kotlin files that are compiled together. For example, we can have separate modules for login and registrations. 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. Internal Modifier While developing a project, we make various modules in the project.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |