public final class MetadataFactory extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MetadataFactory.InstallableUnitDescription
A description containing information about an installable unit.
|
static class |
MetadataFactory.InstallableUnitFragmentDescription
A description containing information about an installable unit fragment.
|
static class |
MetadataFactory.InstallableUnitPatchDescription
A description containing information about an installable unit patch.
|
Constructor and Description |
---|
MetadataFactory() |
Modifier and Type | Method and Description |
---|---|
static ICopyright |
createCopyright(URI location,
String body)
Returns a new
ICopyright . |
static IInstallableUnit |
createInstallableUnit(MetadataFactory.InstallableUnitDescription description)
Returns an
IInstallableUnit based on the given
description. |
static IInstallableUnitFragment |
createInstallableUnitFragment(MetadataFactory.InstallableUnitFragmentDescription description)
Returns an
IInstallableUnitFragment based on the given
description. |
static IInstallableUnitPatch |
createInstallableUnitPatch(MetadataFactory.InstallableUnitPatchDescription description)
Returns an
IInstallableUnitPatch based on the given
description. |
static ILicense |
createLicense(URI location,
String body)
Return a new
ILicense
The body should contain either the full text of the license or an summary for a license
fully specified in the given location. |
static IProvidedCapability |
createProvidedCapability(String namespace,
String name,
Version version)
Returns a
IProvidedCapability with the given values. |
static IRequirement |
createRequirement(IMatchExpression<IInstallableUnit> requirement,
IMatchExpression<IInstallableUnit> filter,
int minCard,
int maxCard,
boolean greedy)
Create and return a new requirement (
IRequirement ) with the specified values. |
static IRequirement |
createRequirement(IMatchExpression<IInstallableUnit> requirement,
IMatchExpression<IInstallableUnit> filter,
int minCard,
int maxCard,
boolean greedy,
String description)
Create and return a new requirement (
IRequirement ) with the specified values. |
static IRequirement |
createRequirement(String namespace,
String name,
VersionRange range,
IMatchExpression<IInstallableUnit> filter,
boolean optional,
boolean multiple)
Returns a
IRequirement with the given values. |
static IRequirement |
createRequirement(String namespace,
String name,
VersionRange range,
IMatchExpression<IInstallableUnit> filter,
int minCard,
int maxCard,
boolean greedy)
Create and return a new requirement (
IRequirement ) with the specified values. |
static IRequirement |
createRequirement(String namespace,
String name,
VersionRange range,
IMatchExpression<IInstallableUnit> filter,
int minCard,
int maxCard,
boolean greedy,
String description)
Create and return a new requirement (
IRequirement ) with the specified values. |
static IRequirement |
createRequirement(String namespace,
String name,
VersionRange range,
String filter,
boolean optional,
boolean multiple,
boolean greedy)
Create and return a new requirement (
IRequirement ) with the specified values. |
static IRequirementChange |
createRequirementChange(IRequirement applyOn,
IRequirement newValue)
Returns a new requirement change.
|
static IInstallableUnit |
createResolvedInstallableUnit(IInstallableUnit unit,
IInstallableUnitFragment[] fragments)
Returns an
IInstallableUnit that represents the given
unit bound to the given fragments. |
static ITouchpointData |
createTouchpointData(Map<String,? extends Object> instructions)
Returns an instance of
ITouchpointData with the given instructions. |
static ITouchpointInstruction |
createTouchpointInstruction(String body,
String importAttribute) |
static ITouchpointType |
createTouchpointType(String id,
Version version)
Returns a
TouchpointType with the given id and version. |
static IUpdateDescriptor |
createUpdateDescriptor(Collection<IMatchExpression<IInstallableUnit>> descriptors,
int severity,
String description,
URI location) |
static IUpdateDescriptor |
createUpdateDescriptor(String id,
VersionRange range,
int severity,
String description)
Creates a new update descriptor object.
|
static IUpdateDescriptor |
createUpdateDescriptor(String id,
VersionRange range,
int severity,
String description,
URI location)
Create and return a new update descriptor
IUpdateDescriptor with the specified values. |
static ITouchpointData |
mergeTouchpointData(ITouchpointData initial,
Map<String,ITouchpointInstruction> incomingInstructions)
Merge the given touchpoint instructions with a pre-existing touchpoint data
|
public static IInstallableUnit createInstallableUnit(MetadataFactory.InstallableUnitDescription description)
IInstallableUnit
based on the given
description. Once the installable unit has been created, the information is
discarded from the description object.description
- The description of the unit to createpublic static IInstallableUnitFragment createInstallableUnitFragment(MetadataFactory.InstallableUnitFragmentDescription description)
IInstallableUnitFragment
based on the given
description. Once the fragment has been created, the information is
discarded from the description object.description
- The description of the unit to createpublic static IInstallableUnitPatch createInstallableUnitPatch(MetadataFactory.InstallableUnitPatchDescription description)
IInstallableUnitPatch
based on the given
description. Once the patch installable unit has been created, the information is
discarded from the description object.description
- The description of the unit to createpublic static IProvidedCapability createProvidedCapability(String namespace, String name, Version version)
IProvidedCapability
with the given values.namespace
- The capability namespacename
- The capability nameversion
- The capability versionpublic static IRequirement createRequirement(String namespace, String name, VersionRange range, IMatchExpression<IInstallableUnit> filter, boolean optional, boolean multiple)
IRequirement
with the given values.namespace
- The capability namespacename
- The required capability namerange
- The range of versions that are required, or null
to indicate that any version will do.filter
- The filter used to evaluate whether this capability is applicable in the
current environment, or null
to indicate this capability is always applicableoptional
- true
if this required capability is optional,
and false
otherwise.multiple
- true
if this capability can be satisfied by multiple provided capabilities,
or false
if it requires exactly one matchpublic static IRequirement createRequirement(String namespace, String name, VersionRange range, IMatchExpression<IInstallableUnit> filter, int minCard, int maxCard, boolean greedy)
IRequirement
) with the specified values.namespace
- the namespace for the requirement. Must not be null
.name
- the name for the requirement. Must not be null
.range
- the version range. A value of null
is equivalent to VersionRange.emptyRange
and matches all versions.filter
- The filter used to evaluate whether this capability is applicable in the
current environment, or null
to indicate this capability is always applicableminCard
- minimum cardinalitymaxCard
- maximum cardinalitygreedy
- true
if the requirement should be considered greedy and false
otherwisepublic static IRequirement createRequirement(IMatchExpression<IInstallableUnit> requirement, IMatchExpression<IInstallableUnit> filter, int minCard, int maxCard, boolean greedy)
IRequirement
) with the specified values.requirement
- the match expressionfilter
- The filter used to evaluate whether this capability is applicable in the
current environment, or null
to indicate this capability is always applicableminCard
- minimum cardinalitymaxCard
- maximum cardinalitygreedy
- true
if the requirement should be considered greedy and false
otherwisepublic static IRequirement createRequirement(String namespace, String name, VersionRange range, String filter, boolean optional, boolean multiple, boolean greedy)
IRequirement
) with the specified values.namespace
- the namespace for the requirement. Must not be null
.name
- the name for the requirement. Must not be null
.range
- the version range. A value of null
is equivalent to VersionRange.emptyRange
and matches all versions.filter
- The filter used to evaluate whether this capability is applicable in the
current environment, or null
to indicate this capability is always applicableoptional
- true
if this requirement is optional, and false
otherwise.multiple
- true
if this requirement can be satisfied by multiple provided capabilities, or false
if it requires exactly one matchgreedy
- true
if the requirement should be considered greedy and false
otherwisepublic static IRequirement createRequirement(String namespace, String name, VersionRange range, IMatchExpression<IInstallableUnit> filter, int minCard, int maxCard, boolean greedy, String description)
IRequirement
) with the specified values.namespace
- the namespace for the requirement. Must not be null
.name
- the name for the requirement. Must not be null
.range
- the version range. A value of null
is equivalent to VersionRange.emptyRange
and matches all versions.filter
- The filter used to evaluate whether this capability is applicable in the
current environment, or null
to indicate this capability is always applicableminCard
- minimum cardinalitymaxCard
- maximum cardinalitygreedy
- true
if the requirement should be considered greedy and false
otherwisedescription
- a String
description of the requirement, or null
public static IRequirement createRequirement(IMatchExpression<IInstallableUnit> requirement, IMatchExpression<IInstallableUnit> filter, int minCard, int maxCard, boolean greedy, String description)
IRequirement
) with the specified values.requirement
- the match expressionfilter
- the filter, or null
minCard
- minimum cardinalitymaxCard
- maximum cardinalitygreedy
- true
if the requirement should be considered greedy and false
otherwisedescription
- a String
description of the requirement, or null
public static IRequirementChange createRequirementChange(IRequirement applyOn, IRequirement newValue)
applyOn
- The source of the requirement change - the kind of requirement to apply the change tonewValue
- The result of the requirement change - the requirement to replace the source requirement withpublic static ICopyright createCopyright(URI location, String body)
ICopyright
.location
- the location of a document containing the copyright notice, or null
body
- the copyright body, cannot be null
IllegalArgumentException
- when the body
is null
public static ILicense createLicense(URI location, String body)
ILicense
The body should contain either the full text of the license or an summary for a license
fully specified in the given location.location
- the location of a document containing the full license, or null
body
- the license body, cannot be null
IllegalArgumentException
- when the body
is null
public static IInstallableUnit createResolvedInstallableUnit(IInstallableUnit unit, IInstallableUnitFragment[] fragments)
IInstallableUnit
that represents the given
unit bound to the given fragments.unit
- The unit to be boundfragments
- The fragments to be boundIInstallableUnit.isResolved()
public static ITouchpointData createTouchpointData(Map<String,? extends Object> instructions)
ITouchpointData
with the given instructions.instructions
- The instructions for the touchpoint data.public static ITouchpointData mergeTouchpointData(ITouchpointData initial, Map<String,ITouchpointInstruction> incomingInstructions)
initial
- - the initial ITouchpointDataincomingInstructions
- - Map of ITouchpointInstructions to merge into the initial touchpoint datapublic static ITouchpointInstruction createTouchpointInstruction(String body, String importAttribute)
public static ITouchpointType createTouchpointType(String id, Version version)
TouchpointType
with the given id and version.id
- The touchpoint idversion
- The touchpoint versionpublic static IUpdateDescriptor createUpdateDescriptor(Collection<IMatchExpression<IInstallableUnit>> descriptors, int severity, String description, URI location)
public static IUpdateDescriptor createUpdateDescriptor(String id, VersionRange range, int severity, String description)
id
- The id of the installable unit that the descriptor provides updates forrange
- The version range that the descriptor provides updates forseverity
- The update severity (either IUpdateDescriptor.NORMAL
or IUpdateDescriptor.HIGH
)description
- A description of the updatepublic static IUpdateDescriptor createUpdateDescriptor(String id, VersionRange range, int severity, String description, URI location)
IUpdateDescriptor
with the specified values.id
- the identifiter for the update. Must not be null
.range
- the version range. A null
range is equivalent to VersionRange.emptyRange
and matches all versions.severity
- the severitydescription
- a String
description or null
location
- a URI
specifying the location or null
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.