How do I add package level annotations or edit package-info.java?
问题 I'm trying to add package level annotations but I don't have a clue on how to do it. Examples are appreciated. 回答1: Summary from the article here In package-info.java: @PackageLevelAnnotation package blammy; // package with a package level annotation. import blammy.annotation.PackageLevelAnnotation; In PackageLevelAnnotation.java package blammy.annotation; @Retention(RetentionPolicy.CLASS) @Target(ElementType.PACKAGE) public @interface PackageLevelAnnotation { // stuff as required. } Edit: