-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from uhafner/generated
Add a new @generated annotation (with class retention)
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package edu.hm.hafner.util; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.ElementType.*; | ||
import static java.lang.annotation.RetentionPolicy.*; | ||
|
||
/** | ||
* This annotation is used to mark source code that has been generated or is somehow not relevant for style checking or | ||
* code coverage analysis. This annotation is quite similar to the annotation @{@link javax.annotation.Generated}. The | ||
* main difference is that it has class retention on so is available for tools that work on the bytecode (like JaCoCo, | ||
* PIT, or SpotBugs). | ||
*/ | ||
@Retention(CLASS) | ||
@Target({PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD, | ||
LOCAL_VARIABLE, PARAMETER}) | ||
public @interface Generated { | ||
/** | ||
* An optional property that identifies the code generator. | ||
* | ||
* @return the name of the generator | ||
*/ | ||
String[] value() default ""; | ||
} |