Created
May 24, 2011 20:54
-
-
Save ran488/989664 to your computer and use it in GitHub Desktop.
SCM Version Annotation
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
package com.ran488.samples.annotation; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Target; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Documented; | |
/** | |
* Custom annotation type used to annotate classes with the SCM version id | |
* string, instead of putting the value in a String field or comment. | |
* Since this is a runtime annotation, the version string can be extracted | |
* out of compiled classes with a decompiler. | |
* Example of usage (ClearCase): | |
* <CODE> | |
* @VersionId("@(#) SomeClass.java [@@/main/some_branch/2]>") | |
* public class SomeClass { | |
* ... | |
* </CODE> | |
*/ | |
@Documented | |
@Target(ElementType.TYPE) | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface VersionId { | |
String value(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment