net.refractions.udig.project
Class IProvider<T>

java.lang.Object
  extended by net.refractions.udig.project.IProvider<T>

public abstract class IProvider<T>
extends java.lang.Object

Provides an object of type T. Used to populate the IBlackboard with default values.

This is used by the net.refractions.udig.project.provider extension point

Since:
1.0.0
Author:
Jesse

Field Summary
static java.lang.String XPID
          Extension point id.
 
Constructor Summary
IProvider()
           
 
Method Summary
 IExtension getExtension()
           
 java.lang.String getKey()
           
abstract  java.lang.Class<T> getProvidee()
          Returns the class of the object being provided.
abstract  T provide()
          Signals the provider to provide an object of the specified class.
 void setExtension(IExtension extension)
          Sets the extension that provier originated from.
 void setKey(java.lang.String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XPID

public static final java.lang.String XPID
Extension point id. *

See Also:
Constant Field Values
Constructor Detail

IProvider

public IProvider()
Method Detail

setExtension

public void setExtension(IExtension extension)
Sets the extension that provier originated from. This method should not be called by client code.

Parameters:
extension - The extension in which the provider was instantiated.

getExtension

public IExtension getExtension()
Returns:
the extension the provider originated from.

getKey

public java.lang.String getKey()
Returns:
the key that is used to identify the object being provided.

setKey

public void setKey(java.lang.String key)
Parameters:
key - the key that is used to identify the object being provided.

getProvidee

public abstract java.lang.Class<T> getProvidee()
Returns the class of the object being provided. How this class relates to the class of objects being provided (via inheritance) is up to the client of the provider.

Returns:
The type of the object being provider (the providee).

provide

public abstract T provide()
Signals the provider to provide an object of the specified class. If the object can not be provided.

Returns:
The object being provided, otherwise null.