Eclipse Platform
2.0

org.eclipse.update.core
Class FeatureReference

java.lang.Object
  |
  +--org.eclipse.core.runtime.PlatformObject
        |
        +--org.eclipse.update.core.model.ModelObject
              |
              +--org.eclipse.update.core.model.FeatureReferenceModel
                    |
                    +--org.eclipse.update.core.FeatureReference
All Implemented Interfaces:
IAdaptable, IFeatureReference
Direct Known Subclasses:
IncludedFeatureReference

public class FeatureReference
extends FeatureReferenceModel
implements IFeatureReference

Convenience implementation of a feature reference.

This class may be instantiated or subclassed by clients.

Since:
2.0
See Also:
IFeatureReference, FeatureReferenceModel

Constructor Summary
FeatureReference()
          Feature reference default constructor
FeatureReference(IFeatureReference ref)
          Constructor 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 feature this reference points to based on match and resolution
 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
 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 class org.eclipse.update.core.model.FeatureReferenceModel
addCategoryName, equals, getCategoryNames, getFeatureIdentifier, getFeatureVersion, getOptions, getSiteModel, getType, getURL, getURLString, removeCategoryName, resolve, setCategoryNames, setFeatureIdentifier, setFeatureVersion, setOptions, setSiteModel, setType, setURLString, toString
 
Methods inherited from class org.eclipse.update.core.model.ModelObject
arrayTypeFor, arrayTypeFor, assertIsWriteable, isReadOnly, markListReferenceReadOnly, markReadOnly, markReferenceReadOnly, resolveListReference, resolveNLString, resolveReference, resolveURL
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.update.core.IFeatureReference
getURL
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

FeatureReference

public FeatureReference()
Feature reference default constructor


FeatureReference

public FeatureReference(IFeatureReference ref)
Constructor FeatureReference.

Parameters:
ref - the reference to copy
Method Detail

getFeature

public IFeature getFeature()
                    throws CoreException
Returns the feature this reference points to based on match and resolution

Specified by:
getFeature in interface IFeatureReference
Returns:
the feature on the Site
CoreException

getSite

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

Specified by:
getSite in interface IFeatureReference
Returns:
feature site
Since:
2.0
See Also:
IFeatureReference.getSite()

getCategories

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

Specified by:
getCategories in interface IFeatureReference
Returns:
an array of categories, or an empty array
Since:
2.0
See Also:
IFeatureReference.getCategories()

addCategory

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

Specified by:
addCategory in interface IFeatureReference
Parameters:
category - new category
Since:
2.0
See Also:
IFeatureReference.addCategory(ICategory)

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.

Specified by:
setURL in interface IFeatureReference
Parameters:
url - reference URL
CoreException
Since:
2.0
See Also:
IFeatureReference.setURL(URL)

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.

Specified by:
setSite in interface IFeatureReference
Parameters:
site - site for the feature reference
Since:
2.0
See Also:
IFeatureReference.setSite(ISite)

getVersionedIdentifier

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

Specified by:
getVersionedIdentifier in interface IFeatureReference
Returns:
the feature identifier.
Throws:
CoreException
Since:
2.0
See Also:
IFeatureReference.getVersionedIdentifier()

getName

public String getName()
Description copied from interface: IFeatureReference
Returns the name of the feature reference.

Specified by:
getName in interface IFeatureReference
Returns:
feature reference name
See Also:
IFeatureReference.getName()

isOptional

public boolean isOptional()
Description copied from interface: IFeatureReference
Returns true if the feature is optional, false otherwise.

Specified by:
isOptional in interface IFeatureReference
Returns:
boolean
See Also:
IFeatureReference.isOptional()

getMatch

public int getMatch()
Description copied from interface: IFeatureReference
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

Specified by:
getMatch in interface IFeatureReference
Returns:
int representation of feature matching rule.
See Also:
IFeatureReference.getMatch()

getSearchLocation

public int getSearchLocation()
Description copied from interface: IFeatureReference
Returns the search location for this included feature. The location will be used to search updates for this feature. The default is SEARCH_ROOT

Specified by:
getSearchLocation in interface IFeatureReference
Returns:
int representation of feature searching rule.
See Also:
IFeatureReference.getSearchLocation()

getFeature

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

Specified by:
getFeature in interface IFeatureReference
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
See Also:
org.eclipse.update.core.IFeatureReference#getFeature(boolean)

Eclipse Platform
2.0

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