[KARAF-5300] Add documentation

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/85b35655
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/85b35655
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/85b35655

Branch: refs/heads/model_features
Commit: 85b35655ad8c39f07270f78b291e47ad17ff41d1
Parents: b716158
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Thu Aug 10 10:33:22 2017 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Thu Aug 10 15:54:06 2017 +0200

----------------------------------------------------------------------
 .../karaf/features/internal/service/FeatureReq.java   | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/85b35655/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureReq.java
----------------------------------------------------------------------
diff --git 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureReq.java
 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureReq.java
index 2e1f652..1bac816 100644
--- 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureReq.java
+++ 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureReq.java
@@ -22,6 +22,15 @@ import org.osgi.framework.VersionRange;
 
 /**
  * Requirement for a feature
+ * 
+ * <p>The syntax of a requirement as a String is name[/versionRange].
+ * If no versionRange is given then a range of [0,) is assumeed which matches 
all versions.
+ * 
+ * <p>
+ * - name: Can be a feature name or a glob like myfeat*
+ * - versionRange: version or range
+ * - version: Will specify a specific version. Like [version,version]. An 
exemption is 0.0.0 which matches all versions.
+ * - range: Like defined in OSGi VersionRange. Example: [1.0.0, 1.1.0)  
  */
 public class FeatureReq {
     public static final String VERSION_SEPARATOR = "/";
@@ -57,7 +66,10 @@ public class FeatureReq {
     }
 
     private static VersionRange exactVersion(String versionRange) {
-        return new VersionRange(VersionRange.LEFT_CLOSED, new 
Version(versionRange), new Version(versionRange), VersionRange.RIGHT_CLOSED);
+        return new VersionRange(VersionRange.LEFT_CLOSED, 
+                                new Version(versionRange), 
+                                new Version(versionRange), 
+                                VersionRange.RIGHT_CLOSED);
     }
 
     public FeatureReq(String name, VersionRange versionRange) {

Reply via email to