You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2015/05/22 22:03:57 UTC

svn commit: r1681221 - in /sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi: ManifestHeader.java OsgiUtil.java PropertiesUtil.java RankedServices.java SortingServiceTracker.java bundleversion/BundleVersionInfo.java

Author: sseifert
Date: Fri May 22 20:03:57 2015
New Revision: 1681221

URL: http://svn.apache.org/r1681221
Log:
update javadocs

Modified:
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/SortingServiceTracker.java
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/bundleversion/BundleVersionInfo.java

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java?rev=1681221&r1=1681220&r2=1681221&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java (original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java Fri May 22 20:03:57 2015
@@ -34,17 +34,17 @@ public class ManifestHeader {
     public interface Entry {
 
         /**
-         * The value of the entry.
+         * @return The value of the entry.
          */
         String getValue();
 
         /**
-         * The attributes specified for this entry.
+         * @return The attributes specified for this entry.
          */
         NameValuePair[] getAttributes();
 
         /**
-         * The directives for this entry.
+         * @return The directives for this entry.
          */
         NameValuePair[] getDirectives();
 
@@ -69,7 +69,7 @@ public class ManifestHeader {
     }
 
     /**
-     * Return the entries for this header.
+     * @return Return the entries for this header.
      */
     public Entry[] getEntries() {
         return this.entries;
@@ -107,6 +107,8 @@ public class ManifestHeader {
      * Like this: path; path; dir1:=dirval1; dir2:=dirval2; attr1=attrval1; attr2=attrval2,
      *            path; path; dir1:=dirval1; dir2:=dirval2; attr1=attrval1; attr2=attrval2
      * The returned object maintains the order of entries (paths), directives and attributes.
+     * @param header Header name
+     * @return Parsed header or null if not found
      */
     public static ManifestHeader parse(String header) {
         final ManifestHeader entry = new ManifestHeader();

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java?rev=1681221&r1=1681220&r2=1681221&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java (original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/OsgiUtil.java Fri May 22 20:03:57 2015
@@ -43,6 +43,7 @@ public class OsgiUtil {
      * object.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default boolean value
+     * @return Boolean value
      */
     public static boolean toBoolean(final Object propValue, final boolean defaultValue) {
         return PropertiesUtil.toBoolean(propValue, defaultValue);
@@ -53,6 +54,7 @@ public class OsgiUtil {
      * <code>defaultValue</code> if the parameter is <code>null</code>.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default string value
+     * @return String value
      */
     public static String toString(final Object propValue, final String defaultValue) {
         return PropertiesUtil.toString(propValue, defaultValue);
@@ -65,6 +67,7 @@ public class OsgiUtil {
      * a <code>Long</code> from the parameter's string value.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default long value
+     * @return Long value
      */
     public static long toLong(final Object propValue, final long defaultValue) {
         return PropertiesUtil.toLong(propValue, defaultValue);
@@ -77,6 +80,7 @@ public class OsgiUtil {
      * an <code>Integer</code> from the parameter's string value.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default integer value
+     * @return Integer value
      */
     public static int toInteger(final Object propValue, final int defaultValue) {
         return PropertiesUtil.toInteger(propValue, defaultValue);
@@ -89,6 +93,7 @@ public class OsgiUtil {
      * a <code>Double</code> from the parameter's string value.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default double value
+     * @return Double value
      *
      * @deprecated since 2.0.4, use {@link #toDouble(Object, double)} instead
      */
@@ -104,6 +109,7 @@ public class OsgiUtil {
      * a <code>Double</code> from the parameter's string value.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default double value
+     * @return Double value
      *
      * @since 2.0.4
      */
@@ -119,6 +125,7 @@ public class OsgiUtil {
      * <code>java.util.Collection</code>, the first collection element is returned.
      * Otherwise <code>null</code> is returned.
      * @param propValue the parameter to convert.
+     * @return Object value
      */
     public static Object toObject(final Object propValue) {
         return PropertiesUtil.toObject(propValue);
@@ -133,6 +140,7 @@ public class OsgiUtil {
      * Otherwise (if the parameter is <code>null</code>) <code>null</code> is
      * returned.
      * @param propValue The object to convert.
+     * @return String array value
      */
     public static String[] toStringArray(final Object propValue) {
         return PropertiesUtil.toStringArray(propValue);
@@ -149,6 +157,7 @@ public class OsgiUtil {
      * @since 2.0.4
      * @param propValue The object to convert.
      * @param defaultArray The default array to return.
+     * @return String array value
      */
     public static String[] toStringArray(final Object propValue, final String[] defaultArray) {
         return PropertiesUtil.toStringArray(propValue, defaultArray);

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java?rev=1681221&r1=1681220&r2=1681221&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java (original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java Fri May 22 20:03:57 2015
@@ -40,6 +40,7 @@ public class PropertiesUtil {
      * object.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default boolean value
+     * @return Boolean value
      */
     public static boolean toBoolean(Object propValue, boolean defaultValue) {
         propValue = toObject(propValue);
@@ -57,6 +58,7 @@ public class PropertiesUtil {
      * <code>defaultValue</code> if the parameter is <code>null</code>.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default string value
+     * @return String value
      */
     public static String toString(Object propValue, String defaultValue) {
         propValue = toObject(propValue);
@@ -70,6 +72,7 @@ public class PropertiesUtil {
      * a <code>Long</code> from the parameter's string value.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default long value
+     * @return Long value
      */
     public static long toLong(Object propValue, long defaultValue) {
         propValue = toObject(propValue);
@@ -93,6 +96,7 @@ public class PropertiesUtil {
      * an <code>Integer</code> from the parameter's string value.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default integer value
+     * @return Integer value
      */
     public static int toInteger(Object propValue, int defaultValue) {
         propValue = toObject(propValue);
@@ -116,6 +120,7 @@ public class PropertiesUtil {
      * a <code>Double</code> from the parameter's string value.
      * @param propValue the property value or <code>null</code>
      * @param defaultValue the default double value
+     * @return Double value
      */
     public static double toDouble(Object propValue, double defaultValue) {
         propValue = toObject(propValue);
@@ -140,6 +145,7 @@ public class PropertiesUtil {
      * <code>java.util.Collection</code>, the first collection element is returned.
      * Otherwise <code>null</code> is returned.
      * @param propValue the parameter to convert.
+     * @return Object value
      */
     public static Object toObject(Object propValue) {
         if (propValue == null) {
@@ -164,6 +170,7 @@ public class PropertiesUtil {
      * Otherwise (if the parameter is <code>null</code>) <code>null</code> is
      * returned.
      * @param propValue The object to convert.
+     * @return String array value
      */
     public static String[] toStringArray(Object propValue) {
         return toStringArray(propValue, null);
@@ -179,6 +186,7 @@ public class PropertiesUtil {
      * returned.
      * @param propValue The object to convert.
      * @param defaultArray The default array to return.
+     * @return String array value
      */
     public static String[] toStringArray(Object propValue, String[] defaultArray) {
         if (propValue == null) {
@@ -236,6 +244,7 @@ public class PropertiesUtil {
      * returned.
      * @param propValue The object to convert.
      * @param defaultArray The default array converted to map.
+     * @return Map value
      */
     public static Map<String, String> toMap(Object propValue, String[] defaultArray) {
         String[] arrayValue = toStringArray(propValue, defaultArray);

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java?rev=1681221&r1=1681220&r2=1681221&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java (original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java Fri May 22 20:03:57 2015
@@ -43,10 +43,10 @@ import aQute.bnd.annotation.ProviderType
  * </pre>
  * <p>2. Define bind/unbind methods that delegate to the RankedServices instance:</p>
  * <pre>
- * void bindMyService(MyService service, Map<String, Object> props) {
+ * void bindMyService(MyService service, Map&lt;String, Object&gt; props) {
  *   myServices.bind(service, props);
  * }
- * void unbindMyService(MyService service, Map<String, Object> props) {
+ * void unbindMyService(MyService service, Map&lt;String, Object&gt; props) {
  *   myServices.unbind(service, props);
  * }
  * </pre>

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/SortingServiceTracker.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/SortingServiceTracker.java?rev=1681221&r1=1681220&r2=1681221&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/SortingServiceTracker.java (original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/SortingServiceTracker.java Fri May 22 20:03:57 2015
@@ -44,6 +44,8 @@ public class SortingServiceTracker<T>
 
     /**
      * Constructor
+     * @param context Bundle context
+     * @param clazz Class
      */
     public SortingServiceTracker(final BundleContext context,
             final String clazz) {
@@ -81,6 +83,7 @@ public class SortingServiceTracker<T>
 
     /**
      * Return a sorted list of the services.
+     * @return Service list
      */
     public List<T> getSortedServices() {
         List<T> result = this.sortedServiceCache;
@@ -107,6 +110,7 @@ public class SortingServiceTracker<T>
 
     /**
      * Return a sorted list of the services references.
+     * @return Service list
      */
     public List<ServiceReference> getSortedServiceReferences() {
         List<ServiceReference> result = this.sortedReferences;

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/bundleversion/BundleVersionInfo.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/bundleversion/BundleVersionInfo.java?rev=1681221&r1=1681220&r2=1681221&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/bundleversion/BundleVersionInfo.java (original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/bundleversion/BundleVersionInfo.java Fri May 22 20:03:57 2015
@@ -40,19 +40,19 @@ public abstract class BundleVersionInfo<
      */
     public static final long BND_LAST_MODIFIED_MISSING = -1L;
     
-    /** Return the source of information: underlying File or Bundle */
+    /** @return Return the source of information: underlying File or Bundle */
     public abstract T getSource();
     
-    /** True if the provided data is a valid bundle */
+    /** @return True if the provided data is a valid bundle */
     public abstract boolean isBundle();
     
-    /** Return the bundle symbolic name, null if not available */
+    /** @return Return the bundle symbolic name, null if not available */
     public abstract String getBundleSymbolicName();
     
-    /** Return the bundle version, null if not available */
+    /** @return Return the bundle version, null if not available */
     public abstract Version getVersion();
     
-    /** True if the bundle version indicates a snapshot */
+    /** @return True if the bundle version indicates a snapshot */
     public abstract boolean isSnapshot();
     
     /** Return the bundle last modification time, based on the BND_LAST_MODIFIED