Eclipse Platform
2.0

org.eclipse.update.core
Interface IFeatureReference

All Superinterfaces:
IAdaptable
All Known Subinterfaces:
IIncludedFeatureReference
All Known Implementing Classes:
FeatureReference, IncludedFeatureReference

public interface IFeatureReference
extends IAdaptable

Feature reference. A reference to a feature on a particular update site.

Clients may implement this interface. However, in most cases clients should directly instantiate or subclass the provided implementation of this interface.

Since:
2.0
See Also:
FeatureReference

Method Summary
 void addCategory(ICategory category)
          Adds a category to the referenced feature.
 ICategory[] getCategories()
          Returns an array of categories the referenced feature belong to.
 IFeature getFeature()
          Returns the referenced feature.
 IFeature getFeature(boolean perfectMatch, org.eclipse.update.configuration.IConfiguredSite configuredSite)
          Returns the referenced feature.
 int getMatch()
          Returns the matching rule for this included feature.
 String getName()
          Returns the name of the feature reference.
 int getSearchLocation()
          Returns the search location for this included feature.
 ISite getSite()
          Returns the update site for the referenced feature
 URL getURL()
          Returns the referenced feature URL.
 VersionedIdentifier getVersionedIdentifier()
          Returns the feature identifier.
 boolean isOptional()
          Returns true if the feature is optional, false otherwise.
 void setSite(ISite site)
          Associates a site with the feature reference.
 void setURL(URL url)
          Sets the feature reference URL.
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Method Detail

getURL

public URL getURL()
Returns the referenced feature URL.

Returns:
feature URL
Since:
2.0

getSite

public ISite getSite()
Returns the update site for the referenced feature

Returns:
feature site
Since:
2.0

getCategories

public ICategory[] getCategories()
Returns an array of categories the referenced feature belong to.

Returns:
an array of categories, or an empty array
Since:
2.0

getFeature

public IFeature getFeature()
                    throws CoreException
Returns the referenced feature. This is a factory method that creates the full feature object.

Returns:
the referenced feature
CoreException
Since:
2.0

getFeature

public IFeature getFeature(boolean perfectMatch,
                           org.eclipse.update.configuration.IConfiguredSite configuredSite)
                    throws CoreException
Returns the referenced feature. This is a factory method that creates the full feature object.

Parameters:
perfectMatch - true if the perfect match feature feature should be returned false if the best match feature should be returned.
configuredSite - the configured site to search for the Feature. If the configured site is null the search will be done in the current configured site.
Returns:
the referenced feature
CoreException
Since:
2.0.2 Note: This method is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

getVersionedIdentifier

public VersionedIdentifier getVersionedIdentifier()
                                           throws CoreException
Returns the feature identifier.

Returns:
the feature identifier.
Throws:
CoreException
Since:
2.0

addCategory

public void addCategory(ICategory category)
Adds a category to the referenced feature.

Parameters:
category - new category
Since:
2.0

setURL

public void setURL(URL url)
            throws CoreException
Sets the feature reference URL. This is typically performed as part of the feature reference creation operation. Once set, the url should not be reset.

Parameters:
url - reference URL
CoreException
Since:
2.0

setSite

public void setSite(ISite site)
Associates a site with the feature reference. This is typically performed as part of the feature reference creation operation. Once set, the site should not be reset.

Parameters:
site - site for the feature reference
Since:
2.0

isOptional

public boolean isOptional()
Returns true if the feature is optional, false otherwise.

Returns:
boolean
Since:
2.0.1

getName

public String getName()
Returns the name of the feature reference.

Returns:
feature reference name
Since:
2.0.1

getMatch

public int getMatch()
Returns the matching rule for this included feature. The rule will determine the ability of the included feature to move version without causing the overall feature to appear broken. The default is RULE_PERFECT

Returns:
int representation of feature matching rule.
Since:
2.0.2
See Also:
IUpdateConstants.RULE_PERFECT, IUpdateConstants.RULE_EQUIVALENT, IUpdateConstants.RULE_COMPATIBLE, IUpdateConstants.RULE_GREATER_OR_EQUAL

getSearchLocation

public int getSearchLocation()
Returns the search location for this included feature. The location will be used to search updates for this feature. The default is SEARCH_ROOT

Returns:
int representation of feature searching rule.
Since:
2.0.2
See Also:
IFeatureReference#SEARCH_ROOT, IFeatureReference#SEARCH_SELF

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.