diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
commit | 72231250ed81e10d66bfe70701e64fa5fe50f712 (patch) | |
tree | 2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /annotations/src/main |
Publish
Diffstat (limited to 'annotations/src/main')
6 files changed, 77 insertions, 0 deletions
diff --git a/annotations/src/main/java/com/yahoo/api/annotations/PublicApi.java b/annotations/src/main/java/com/yahoo/api/annotations/PublicApi.java new file mode 100644 index 00000000000..7bb250a8b73 --- /dev/null +++ b/annotations/src/main/java/com/yahoo/api/annotations/PublicApi.java @@ -0,0 +1,23 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.api.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * For annotating packages that should be part of the public API. + * + * Must be placed in a file called package-info.java in the + * package that is to be public. + * @author tonytv + * @author gjoranv + * @since 5.1.5 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PACKAGE) +@Documented +public @interface PublicApi { +} diff --git a/annotations/src/main/java/com/yahoo/api/annotations/package-info.java b/annotations/src/main/java/com/yahoo/api/annotations/package-info.java new file mode 100644 index 00000000000..d4c7c9a8a1a --- /dev/null +++ b/annotations/src/main/java/com/yahoo/api/annotations/package-info.java @@ -0,0 +1,3 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +@PublicApi +package com.yahoo.api.annotations; diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java b/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java new file mode 100644 index 00000000000..f3bf17e29bd --- /dev/null +++ b/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java @@ -0,0 +1,23 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.osgi.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * For annotating packages that should be exported. + * + * Must be placed in a file called package-info.java in the + * package that is to be exported. + * + * @author tonytv + */ +@Retention(RetentionPolicy.CLASS) +@Target(ElementType.PACKAGE) +@Documented +public @interface ExportPackage { + Version version() default @Version; +} diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java b/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java new file mode 100644 index 00000000000..69379780182 --- /dev/null +++ b/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java @@ -0,0 +1,24 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.osgi.annotation; + +/** + * Version of an exported package + * The default version is 1.0.0 + * @see <a href="http://www.osgi.org/javadoc/r4v43/org/osgi/framework/Version.html">Osgi version documentation</a> + * @author tonytv + */ +public @interface Version { + + /** must be non-negative **/ + int major() default 1; + + /** must be non-negative **/ + int minor() default 0; + + /** must be non-negative **/ + int micro() default 0; + + /** must follow the format (alpha|digit|'_'|'-')+ **/ + String qualifier() default ""; + +} diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java b/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java new file mode 100644 index 00000000000..5e84b29d8f3 --- /dev/null +++ b/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java @@ -0,0 +1,3 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +@com.yahoo.api.annotations.PublicApi +package com.yahoo.osgi.annotation; diff --git a/annotations/src/main/resources/.gitignore b/annotations/src/main/resources/.gitignore new file mode 100644 index 00000000000..b347c417aa1 --- /dev/null +++ b/annotations/src/main/resources/.gitignore @@ -0,0 +1 @@ +/getversion |