aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2011-11-22 11:06:58 (EST)
committerJohn Ross2011-11-22 11:08:24 (EST)
commit54a28d51979513dda2948dfd597babfb14e9dc8f (patch)
tree1c34b05cabeb74ca9b226dcc62e389c6b9a5f240
parente7e671db3f0e0b30007d6411b66fc188c6e3f6f8 (diff)
downloadrt.equinox.bundles-54a28d51979513dda2948dfd597babfb14e9dc8f.zip
rt.equinox.bundles-54a28d51979513dda2948dfd597babfb14e9dc8f.tar.gz
rt.equinox.bundles-54a28d51979513dda2948dfd597babfb14e9dc8f.tar.bz2
Bug 353049: Completed the Extendable API Javadoc.
-rw-r--r--bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxAttributeDefinition.java8
-rw-r--r--bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeInformation.java6
-rw-r--r--bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeService.java10
-rw-r--r--bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxObjectClassDefinition.java12
-rw-r--r--bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/Extendable.java26
5 files changed, 61 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxAttributeDefinition.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxAttributeDefinition.java
index 5baaae0..99070ff 100644
--- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxAttributeDefinition.java
+++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxAttributeDefinition.java
@@ -10,6 +10,14 @@ package org.eclipse.equinox.metatype;
import org.osgi.service.metatype.AttributeDefinition;
/**
+ * An {@link Extendable extendable} version of {@link AttributeDefinition
+ * attribute definition} allowing access to any {@link
+ * Extendable#getExtensionAttributes(String) extension attributes} provided by
+ * third parties.
+ * <p/>
+ * For example, an Equinox attribute definition will contain all XML attributes
+ * specified as part of the &lt;AD/&gt; element with namespaces other than the
+ * metatype namespace as extension attributes.
*
* @since 1.2
*
diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeInformation.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeInformation.java
index 345d79d..ee6fffb 100644
--- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeInformation.java
+++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeInformation.java
@@ -10,10 +10,16 @@ package org.eclipse.equinox.metatype;
import org.osgi.service.metatype.MetaTypeInformation;
/**
+ * A {@link MetaTypeInformation} that provides {@link Extendable extendable}
+ * versions of {@link EquinoxObjectClassDefinition object class definitions}.
*
* @since 1.2
*
*/
public interface EquinoxMetaTypeInformation extends MetaTypeInformation {
+ /**
+ * Returns {@link Extendable extendable} versions of {@link
+ * EquinoxObjectClassDefinition object class definitions}.
+ */
EquinoxObjectClassDefinition getObjectClassDefinition(String id, String locale);
}
diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeService.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeService.java
index e2154f5..e11ebd8 100644
--- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeService.java
+++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxMetaTypeService.java
@@ -8,13 +8,21 @@
package org.eclipse.equinox.metatype;
import org.osgi.framework.Bundle;
+import org.osgi.service.metatype.MetaTypeInformation;
import org.osgi.service.metatype.MetaTypeService;
/**
- *
+ * A {@link MetaTypeService} providing {@link MetaTypeInformation} instances
+ * with {@link Extendable extendable} versions of {@link
+ * EquinoxObjectClassDefinition object class definitions}.
* @since 1.2
*
*/
public interface EquinoxMetaTypeService extends MetaTypeService {
+ /**
+ * Returns a {@link MetaTypeInformation} that provides {@link Extendable
+ * extendable} versions of {@link EquinoxObjectClassDefinition object class
+ * definitions}.
+ */
EquinoxMetaTypeInformation getMetaTypeInformation(Bundle bundle);
}
diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxObjectClassDefinition.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxObjectClassDefinition.java
index efb8c3f..5db4693 100644
--- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxObjectClassDefinition.java
+++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/EquinoxObjectClassDefinition.java
@@ -10,10 +10,22 @@ package org.eclipse.equinox.metatype;
import org.osgi.service.metatype.ObjectClassDefinition;
/**
+ * An {@link Extendable extendable} version of {@link ObjectClassDefinition
+ * object class definition} allowing access to any {@link
+ * Extendable#getExtensionAttributes(String) extension attributes} provided by
+ * third parties.
+ * <p/>
+ * For example, an Equinox object class definition will contain all XML
+ * attributes specified as part of the &lt;OCD/&gt; element with namespaces
+ * other than the metatype namespace as extension attributes.
*
* @since 1.2
*
*/
public interface EquinoxObjectClassDefinition extends ObjectClassDefinition, Extendable {
+ /**
+ * Returns {@link Extendable extendable} versions of {@link
+ * EquinoxAttributeDefinition attribute definitions}.
+ */
EquinoxAttributeDefinition[] getAttributeDefinitions(int filter);
}
diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/Extendable.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/Extendable.java
index 4f6069e..dc93171 100644
--- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/Extendable.java
+++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/Extendable.java
@@ -11,12 +11,38 @@ import java.util.Map;
import java.util.Set;
/**
+ * An interface marking an object as possibly having extension attributes. An
+ * attribute is a property that describes the object. An extension attribute is
+ * a custom property added by a third party.
+ *
+ * The use case for this interface was to expose third party attributes
+ * included in the metadata XML on elements that support <anyAttribute/>
+ * according to the metatype schema, but it is not strictly limited to this use.
*
* @since 1.2
*
*/
public interface Extendable {
+ /**
+ * Returns a {@link Map map} containing the extension attributes for the
+ * specified {@link #getExtensionUris() URI}. The map key is the attribute
+ * name, and the map value is the attribute value. If the specified URI has
+ * no extension attributes, the map will be {@code null}.
+ *
+ * @param uri - The URI for which extension attributes are desired.
+ * @return A map containing the extension attributes for the specified URI,
+ * or {@code null} if there are none.
+ * @see #getExtensionUris()
+ */
Map<String, String> getExtensionAttributes(String uri);
+ /**
+ * Returns the {@link Set set} of URIs for which {@link
+ * #getExtensionAttributes(String) extension attributes} exist. It is
+ * guaranteed that there is at least one extension attribute for each URI
+ * in the set.
+ * @return A set containing the URIs for which extension attributes exist.
+ * @see #getExtensionAttributes(String)
+ */
Set<String> getExtensionUris();
}