Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 5baaae0b7..99070ffd2 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 345d79d55..ee6fffb04 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 e2154f5bf..e11ebd8c0 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 efb8c3ff3..5db4693e2 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 4f6069ec5..dc93171cc 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();
}

Back to the top