Eclipse Platform
2.0

org.eclipse.update.core.model
Class FeatureReferenceModel

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

public class FeatureReferenceModel
extends ModelObject

Feature reference model object.

This class may be instantiated or subclassed by clients. However, in most cases clients should instead instantiate or subclass the provided concrete implementation of this model.

Since:
2.0
See Also:
FeatureReference

Constructor Summary
FeatureReferenceModel()
          Creates an uninitialized feature reference model object.
 
Method Summary
 void addCategoryName(String categoryName)
          Adds the name of a category this feature belongs to.
 boolean equals(Object object)
          Compares 2 feature reference models for equality
 String[] getCategoryNames()
          Returns the names of categories the referenced feature belongs to.
 String getFeatureIdentifier()
          Returns the feature identifier as a string
 String getFeatureVersion()
          Returns the feature version as a string
 SiteModel getSiteModel()
          Returns the site model for the reference.
 String getType()
          Returns the referenced feature type.
 URL getURL()
          Returns the resolved URL for the feature reference.
 String getURLString()
          Returns the unresolved URL string for the reference.
 void removeCategoryName(String categoryName)
          Removes the name of a categorys this feature belongs to.
 void resolve(URL base, ResourceBundle bundle)
          Resolve the model object.
 void setCategoryNames(String[] categoryNames)
          Sets the names of categories this feature belongs to.
 void setFeatureIdentifier(String featureId)
          Sets the feature identifier.
 void setFeatureVersion(String featureVersion)
          Sets the feature version.
 void setSiteModel(SiteModel site)
          Sets the site for the referenced.
 void setType(String type)
          Sets the referenced feature type.
 void setURLString(String urlString)
          Sets the unresolved URL for the feature reference.
 String 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
 

Constructor Detail

FeatureReferenceModel

public FeatureReferenceModel()
Creates an uninitialized feature reference model object.

Since:
2.0
Method Detail

equals

public boolean equals(Object object)
Compares 2 feature reference models for equality

Overrides:
equals in class Object
Parameters:
object - feature reference model to compare with
Returns:
true if the two models are equal, false otherwise
Since:
2.0

getType

public String getType()
Returns the referenced feature type.

Returns:
feature type, or null representing the default feature type for the site
Since:
2.0

getSiteModel

public SiteModel getSiteModel()
Returns the site model for the reference.

Returns:
site model
Since:
2.0

getURLString

public String getURLString()
Returns the unresolved URL string for the reference.

Returns:
url string
Since:
2.0

getURL

public URL getURL()
Returns the resolved URL for the feature reference.

Returns:
url string
Since:
2.0

getCategoryNames

public String[] getCategoryNames()
Returns the names of categories the referenced feature belongs to.

Returns:
an array of names, or an empty array.
Since:
2.0

getFeatureIdentifier

public String getFeatureIdentifier()
Returns the feature identifier as a string

Returns:
feature identifier
Since:
2.0
See Also:
IFeatureReference.getVersionedIdentifier()

getFeatureVersion

public String getFeatureVersion()
Returns the feature version as a string

Returns:
feature version
Since:
2.0
See Also:
IFeatureReference.getVersionedIdentifier()

setType

public void setType(String type)
Sets the referenced feature type. Throws a runtime exception if this object is marked read-only.

Parameters:
type - referenced feature type
Since:
2.0

setSiteModel

public void setSiteModel(SiteModel site)
Sets the site for the referenced. Throws a runtime exception if this object is marked read-only.

Parameters:
site - site for the reference
Since:
2.0

setURLString

public void setURLString(String urlString)
Sets the unresolved URL for the feature reference. Throws a runtime exception if this object is marked read-only.

Parameters:
urlString - unresolved URL string
Since:
2.0

setFeatureIdentifier

public void setFeatureIdentifier(String featureId)
Sets the feature identifier. Throws a runtime exception if this object is marked read-only.

Parameters:
featureId - feature identifier
Since:
2.0

setFeatureVersion

public void setFeatureVersion(String featureVersion)
Sets the feature version. Throws a runtime exception if this object is marked read-only.

Parameters:
featureVersion - feature version
Since:
2.0

setCategoryNames

public void setCategoryNames(String[] categoryNames)
Sets the names of categories this feature belongs to. Throws a runtime exception if this object is marked read-only.

Parameters:
categoryNames - an array of category names
Since:
2.0

addCategoryName

public void addCategoryName(String categoryName)
Adds the name of a category this feature belongs to. Throws a runtime exception if this object is marked read-only.

Parameters:
categoryName - category name
Since:
2.0

removeCategoryName

public void removeCategoryName(String categoryName)
Removes the name of a categorys this feature belongs to. Throws a runtime exception if this object is marked read-only.

Parameters:
categoryName - category name
Since:
2.0

resolve

public void resolve(URL base,
                    ResourceBundle bundle)
             throws MalformedURLException
Resolve the model object. Any URL strings in the model are resolved relative to the base URL argument. Any translatable strings in the model that are specified as translation keys are localized using the supplied resource bundle.

Overrides:
resolve in class ModelObject
Parameters:
base - URL
bundle - resource bundle
Throws:
MalformedURLException
Since:
2.0

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

Eclipse Platform
2.0

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