com.ibm.portal.resolver.helper.eclipse
Class Platform

java.lang.Object
  extended by com.ibm.portal.resolver.helper.eclipse.Platform

public abstract class Platform
extends java.lang.Object

Convenience class to get easy access to the IExtensionRegistry.

Since:
7.0.0.0

Field Summary
static java.lang.String FIELD_ATTR_CLASS
           
static java.lang.String FIELD_DEFAULT_EXTENSION_ID
           
static java.lang.String FIELD_EXTENSION_POINT_ID
           
 
Method Summary
static
<T> T
createInstance(java.lang.Class<T> aClass)
          Instantiates an eclipse extension
static
<T> T
createInstance(java.lang.Class<T> aClass, org.eclipse.core.runtime.IExtensionRegistry extReg)
          Creates an instance based on information from the class object.
static java.lang.Object createInstance(java.lang.String extPointId, java.lang.String extId, java.lang.String propertyName)
          Tries to instantiate a particular extension
static java.lang.Object createInstance(java.lang.String extPointId, java.lang.String extId, java.lang.String propertyName, org.eclipse.core.runtime.IExtensionRegistry extReg)
          Tries to instantiate a particular extension
static java.lang.Object disposeObject(java.lang.Object obj)
          Checks if the object extends Disposable and disposes it in this case
static org.eclipse.core.runtime.IExtensionRegistry getExtensionRegistry()
          Provide simply access to the extension registry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_ATTR_CLASS

public static final java.lang.String FIELD_ATTR_CLASS
See Also:
Constant Field Values

FIELD_DEFAULT_EXTENSION_ID

public static final java.lang.String FIELD_DEFAULT_EXTENSION_ID
See Also:
Constant Field Values

FIELD_EXTENSION_POINT_ID

public static final java.lang.String FIELD_EXTENSION_POINT_ID
See Also:
Constant Field Values
Method Detail

createInstance

public static <T> T createInstance(java.lang.Class<T> aClass)
                        throws java.io.IOException
Instantiates an eclipse extension

Parameters:
aClass - the class object of the interface.
Returns:
the instantiated object
Throws:
java.io.IOException
Since:
7.0

createInstance

public static <T> T createInstance(java.lang.Class<T> aClass,
                                   org.eclipse.core.runtime.IExtensionRegistry extReg)
                        throws java.io.IOException
Creates an instance based on information from the class object. The class must declare static public strings that define the name of the extension point, the extension and the attribute name.

Parameters:
aClass - the class object of the
extReg - the extension registry instance
Returns:
the instantiated service
Throws:
java.io.IOException
Since:
7.0
See Also:
FIELD_ATTR_CLASS, FIELD_DEFAULT_EXTENSION_ID, FIELD_EXTENSION_POINT_ID

createInstance

public static java.lang.Object createInstance(java.lang.String extPointId,
                                              java.lang.String extId,
                                              java.lang.String propertyName)
                                       throws java.io.IOException
Tries to instantiate a particular extension

Parameters:
extPointId -
extId -
propertyName -
Returns:
Throws:
ResolutionException
java.io.IOException
Since:
6.1.0.1

createInstance

public static java.lang.Object createInstance(java.lang.String extPointId,
                                              java.lang.String extId,
                                              java.lang.String propertyName,
                                              org.eclipse.core.runtime.IExtensionRegistry extReg)
                                       throws java.io.IOException
Tries to instantiate a particular extension

Parameters:
extPointId -
extId -
propertyName -
extReg -
Returns:
the instantiated object
Throws:
ResolutionException
java.io.IOException
Since:
7.0

disposeObject

public static java.lang.Object disposeObject(java.lang.Object obj)
Checks if the object extends Disposable and disposes it in this case

Parameters:
obj - object to be disposed
Returns:
the null value

getExtensionRegistry

public static final org.eclipse.core.runtime.IExtensionRegistry getExtensionRegistry()
Provide simply access to the extension registry

Returns:
the extension registry or null if the registry could not be found