Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2009-11-29 20:33:00 +0000
committerPascal Rapicault2009-11-29 20:33:00 +0000
commitd4338c3ad32c3386439e6fa8e08d5fd28238f035 (patch)
treee5fa1c7669d17278911a544580c85a56f03d7c13
parentc85981fff70790e0a42ec40f9914751e7251db18 (diff)
downloadrt.equinox.p2-d4338c3ad32c3386439e6fa8e08d5fd28238f035.tar.gz
rt.equinox.p2-d4338c3ad32c3386439e6fa8e08d5fd28238f035.tar.xz
rt.equinox.p2-d4338c3ad32c3386439e6fa8e08d5fd28238f035.zip
Remove concept of selector
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/XMLConstants.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/NotRequirement.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ORRequirement.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/RequiredCapability.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/IRequiredCapability.java14
7 files changed, 0 insertions, 97 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java
index aad11273d..9d187c28d 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java
@@ -564,7 +564,6 @@ public abstract class MetadataParser extends XMLParser implements XMLConstants {
private IRequiredCapability currentCapability = null;
private TextHandler filterHandler = null;
- private CapabilitySelectorsHandler selectorsHandler = null;
public RequiredCapabilityHandler(AbstractHandler parentHandler, Attributes attributes, List capabilities) {
super(parentHandler, REQUIRED_CAPABILITY_ELEMENT);
@@ -580,8 +579,6 @@ public abstract class MetadataParser extends XMLParser implements XMLConstants {
public void startElement(String name, Attributes attributes) {
if (name.equals(CAPABILITY_FILTER_ELEMENT)) {
filterHandler = new TextHandler(this, CAPABILITY_FILTER_ELEMENT, attributes);
- } else if (name.equals(CAPABILITY_SELECTORS_ELEMENT)) {
- selectorsHandler = new CapabilitySelectorsHandler(this, attributes);
} else {
invalidElement(name, attributes);
}
@@ -593,9 +590,6 @@ public abstract class MetadataParser extends XMLParser implements XMLConstants {
if (filterHandler != null) {
currentCapability.setFilter(filterHandler.getText());
}
- if (selectorsHandler != null) {
- currentCapability.setSelectors(selectorsHandler.getSelectors());
- }
}
}
}
@@ -640,29 +634,6 @@ public abstract class MetadataParser extends XMLParser implements XMLConstants {
}
}
- protected class CapabilitySelectorsHandler extends AbstractHandler {
-
- private List selectors;
-
- public CapabilitySelectorsHandler(AbstractHandler parentHandler, Attributes attributes) {
- super(parentHandler, CAPABILITY_SELECTORS_ELEMENT);
- String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE);
- selectors = (size != null ? new ArrayList(new Integer(size).intValue()) : new ArrayList(4));
- }
-
- public String[] getSelectors() {
- return (String[]) selectors.toArray(new String[selectors.size()]);
- }
-
- public void startElement(String name, Attributes attributes) {
- if (name.equals(CAPABILITY_SELECTOR_ELEMENT)) {
- new TextHandler(this, CAPABILITY_SELECTOR_ELEMENT, attributes, selectors);
- } else {
- invalidElement(name, attributes);
- }
- }
- }
-
protected class TouchpointTypeHandler extends AbstractHandler {
private final String[] required = new String[] {ID_ATTRIBUTE, VERSION_ATTRIBUTE};
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
index 043692eb7..11cb8cc29 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
@@ -190,17 +190,6 @@ public abstract class MetadataWriter extends XMLWriter implements XMLConstants {
attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, capability.isMultiple(), false);
attribute(CAPABILITY_GREED_ATTRIBUTE, capability.isGreedy(), true);
writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, capability.getFilter());
-
- String[] selectors = capability.getSelectors();
- if (selectors.length > 0) {
- start(CAPABILITY_SELECTORS_ELEMENT);
- attribute(COLLECTION_SIZE_ATTRIBUTE, selectors.length);
- for (int j = 0; j < selectors.length; j++) {
- writeTrimmedCdata(CAPABILITY_SELECTOR_ELEMENT, selectors[j]);
- }
- end(CAPABILITY_SELECTORS_ELEMENT);
- }
-
end(REQUIRED_CAPABILITY_ELEMENT);
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/XMLConstants.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/XMLConstants.java
index 2d6fd7025..27c8faaf2 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/XMLConstants.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/XMLConstants.java
@@ -64,8 +64,6 @@ public interface XMLConstants extends org.eclipse.equinox.internal.p2.persistenc
// Constants for sub-elements of a required capability element
public static final String CAPABILITY_FILTER_ELEMENT = "filter"; //$NON-NLS-1$
- public static final String CAPABILITY_SELECTORS_ELEMENT = "selectors"; //$NON-NLS-1$
- public static final String CAPABILITY_SELECTOR_ELEMENT = "selector"; //$NON-NLS-1$
// Constants for attributes of a required capability element
public static final String CAPABILITY_OPTIONAL_ATTRIBUTE = "optional"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/NotRequirement.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/NotRequirement.java
index 752d5444e..c56f58c7a 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/NotRequirement.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/NotRequirement.java
@@ -29,10 +29,6 @@ public class NotRequirement implements IRequiredCapability {
return negatedRequirement.getRange();
}
- public String[] getSelectors() {
- return negatedRequirement.getSelectors();
- }
-
public boolean isGreedy() {
return negatedRequirement.isGreedy();
}
@@ -47,12 +43,6 @@ public class NotRequirement implements IRequiredCapability {
public void setFilter(String filter) {
// TODO Auto-generated method stub
-
- }
-
- public void setSelectors(String[] selectors) {
- // TODO Auto-generated method stub
-
}
public boolean isNegation() {
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ORRequirement.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ORRequirement.java
index 3aab2c9ff..242c07bde 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ORRequirement.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ORRequirement.java
@@ -33,11 +33,6 @@ public class ORRequirement implements IRequiredCapability {
return null;
}
- public String[] getSelectors() {
- // TODO Auto-generated method stub
- return null;
- }
-
public boolean isGreedy() {
// TODO Auto-generated method stub
return true;
@@ -57,11 +52,6 @@ public class ORRequirement implements IRequiredCapability {
}
- public void setSelectors(String[] selectors) {
- // TODO Auto-generated method stub
-
- }
-
public boolean isNegation() {
return false;
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/RequiredCapability.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/RequiredCapability.java
index 690c9e1ba..fd8aa7556 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/RequiredCapability.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/RequiredCapability.java
@@ -28,8 +28,6 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.*;
* @see IInstallableUnit#NAMESPACE_IU_ID
*/
public class RequiredCapability implements IRequiredCapability {
- private static final String[] NO_SELECTORS = new String[0];
-
private String filter;
private final boolean multiple;
private final String name;//never null
@@ -37,7 +35,6 @@ public class RequiredCapability implements IRequiredCapability {
private boolean optional;
private boolean greedy = true;
private final VersionRange range;//never null
- private String[] selectors = NO_SELECTORS;//never null
/**
* TODO replace booleans with int options flag.
@@ -106,16 +103,6 @@ public class RequiredCapability implements IRequiredCapability {
return range;
}
- /**
- * Returns the properties to use for evaluating required capability filters
- * downstream from this capability. For example, if the selector "doc"
- * is provided, then a downstream InstallableUnit with a required capability
- * filtered with "doc=true" will be included.
- */
- public String[] getSelectors() {
- return selectors;
- }
-
public int hashCode() {
final int prime = 31;
int result = 1;
@@ -144,14 +131,6 @@ public class RequiredCapability implements IRequiredCapability {
this.filter = filter;
}
- /**
- * TODO This object shouldn't be mutable since it makes equality unstable, and
- * introduces lifecycle issues (how are the changes persisted, etc)
- */
- public void setSelectors(String[] selectors) {
- this.selectors = selectors;
- }
-
public boolean isGreedy() {
return greedy;
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/IRequiredCapability.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/IRequiredCapability.java
index 9e0b652e6..db138b584 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/IRequiredCapability.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/IRequiredCapability.java
@@ -41,14 +41,6 @@ public interface IRequiredCapability {
*/
public VersionRange getRange();
- /**
- * Returns the properties to use for evaluating required capability filters
- * downstream from this capability. For example, if the selector "doc"
- * is provided, then a downstream InstallableUnit with a required capability
- * filtered with "doc=true" will be included.
- */
- public String[] getSelectors();
-
public boolean isMultiple();
public boolean isOptional();
@@ -59,12 +51,6 @@ public interface IRequiredCapability {
*/
public void setFilter(String filter);
- /**
- * TODO This object shouldn't be mutable since it makes equality unstable, and
- * introduces lifecycle issues (how are the changes persisted, etc)
- */
- public void setSelectors(String[] selectors);
-
public boolean isGreedy();
/**

Back to the top