diff options
author | John Arthorne | 2009-01-21 20:22:03 +0000 |
---|---|---|
committer | John Arthorne | 2009-01-21 20:22:03 +0000 |
commit | b36bbddb0407962824061e1144e7ae884968628f (patch) | |
tree | 0b0c4b5eb007cd973ba385c2d9a1308824f5bf47 /bundles/org.eclipse.equinox.p2.metadata | |
parent | b61d7b583c112b2ca4bfb92c7719a80d4514c886 (diff) | |
download | rt.equinox.p2-b36bbddb0407962824061e1144e7ae884968628f.tar.gz rt.equinox.p2-b36bbddb0407962824061e1144e7ae884968628f.tar.xz rt.equinox.p2-b36bbddb0407962824061e1144e7ae884968628f.zip |
Bug 257987 [metadata] Should the factory automatically set the IU type
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.metadata')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java index d62fd2874..f885deac7 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java @@ -22,6 +22,12 @@ import org.eclipse.equinox.internal.provisional.p2.core.VersionRange; * A factory class for instantiating various p2 metadata objects. */ public class MetadataFactory { + /** + * A description containing information about an installable unit. Once created, + * installable units are immutable. This description class allows a client to build + * up the state for an installable unit incrementally, and then finally product + * the resulting immutable unit. + */ public static class InstallableUnitDescription { protected InstallableUnit unit; @@ -148,7 +154,16 @@ public class MetadataFactory { } } + /** + * Description of an installable unit patch. The description will automatically have + * the {@link IInstallableUnit#PROP_TYPE_FRAGMENT} set to <code>true</code>. + */ public static class InstallableUnitFragmentDescription extends InstallableUnitDescription { + public InstallableUnitFragmentDescription() { + super(); + setProperty(IInstallableUnit.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); + } + public void setHost(IRequiredCapability[] hostRequirements) { ((InstallableUnitFragment) unit()).setHost(hostRequirements); } @@ -160,8 +175,17 @@ public class MetadataFactory { } } + /** + * Description of an installable unit patch. The description will automatically have + * the {@link IInstallableUnit#PROP_TYPE_PATCH} set to <code>true</code>. + */ public static class InstallableUnitPatchDescription extends InstallableUnitDescription { + public InstallableUnitPatchDescription() { + super(); + setProperty(IInstallableUnit.PROP_TYPE_PATCH, Boolean.TRUE.toString()); + } + public void setApplicabilityScope(IRequiredCapability[][] applyTo) { if (applyTo == null) throw new IllegalArgumentException("A patch scope can not be null"); //$NON-NLS-1$ |