com.ibm.portal.resolver.cor.helper
Class DefaultContentOperationsRegistryFactory

java.lang.Object
  extended by com.ibm.portal.resolver.cor.helper.DefaultContentOperationsRegistryFactory
All Implemented Interfaces:
ContentOperationsRegistryFactory, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.core.runtime.IExecutableExtensionFactory

public abstract class DefaultContentOperationsRegistryFactory
extends java.lang.Object
implements org.eclipse.core.runtime.IExecutableExtensionFactory, org.eclipse.core.runtime.IExecutableExtension, ContentOperationsRegistryFactory

Baseclass that can be used to easily implement a ContentOperationsRegistryFactory. Implementory typically use this class in the following ways:

Since:
6.1.0.3
See Also:
createObject(Class, ContentOperationsRegistryDependencies), getTargetClass()
Note:
This interface is designed to be implemented by clients.

Constructor Summary
DefaultContentOperationsRegistryFactory()
           
 
Method Summary
 java.lang.Object create()
           
<T> T
create(java.lang.Class<T> cls, ContentOperationsRegistryDependencies ctx)
          Creates an object based on a services context
protected  java.lang.Object createObject(java.lang.Class<?> aClass, ContentOperationsRegistryDependencies aContext)
          Method to override
protected  java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> aClass)
          Returns the constructor that takes the desired dependency object
protected  java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> aClass, java.lang.Class<?> aDependency)
          Returns the constructor that takes a particular dependency
protected  java.lang.Object getDependencies()
          Returns the extra object that is used to resolve dependencies.
protected  java.lang.String getFilter()
          Returns the filter string for the dependency callback
protected  java.lang.Class<?> getTargetClass()
          Returns the target class to actually instantiate
 void setInitializationData(org.eclipse.core.runtime.IConfigurationElement cr, java.lang.String property, java.lang.Object data)
           
protected  java.lang.String toString(java.lang.Object aObj)
          Returns a debug version of the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultContentOperationsRegistryFactory

public DefaultContentOperationsRegistryFactory()
Method Detail

create

public java.lang.Object create()
                        throws org.eclipse.core.runtime.CoreException
Specified by:
create in interface org.eclipse.core.runtime.IExecutableExtensionFactory
Throws:
org.eclipse.core.runtime.CoreException

create

public final <T> T create(java.lang.Class<T> cls,
                          ContentOperationsRegistryDependencies ctx)
               throws org.eclipse.core.runtime.CoreException
Description copied from interface: ContentOperationsRegistryFactory
Creates an object based on a services context

Specified by:
create in interface ContentOperationsRegistryFactory
Parameters:
cls - the class object of the requested interface
ctx - the context
Returns:
the object or null
Throws:
org.eclipse.core.runtime.CoreException

createObject

protected java.lang.Object createObject(java.lang.Class<?> aClass,
                                        ContentOperationsRegistryDependencies aContext)
                                 throws org.eclipse.core.runtime.CoreException
Method to override

Parameters:
aClass - class to create
aContext - the context
Returns:
the returned object
Throws:
org.eclipse.core.runtime.CoreException

getConstructor

protected java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> aClass)
                                                   throws java.lang.NoSuchMethodException
Returns the constructor that takes the desired dependency object

Parameters:
aClass - the class object, not null
Returns:
the constructor
Throws:
java.lang.NoSuchMethodException - if a suitable constructor could not be located
Since:
8.0

getConstructor

protected final java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> aClass,
                                                                java.lang.Class<?> aDependency)
                                                         throws java.lang.NoSuchMethodException
Returns the constructor that takes a particular dependency

Parameters:
aClass - the class object of the target class
aDependency - the dependency interface
Returns:
the constructor that creates the class or null
Throws:
java.lang.NoSuchMethodException
java.lang.NoSuchMethodException - if a suitable constructor could not be located
Since:
8.0

getDependencies

protected java.lang.Object getDependencies()
Returns the extra object that is used to resolve dependencies. Per default the method returns this.

Returns:
the dependency object, may return null
Since:
8.0

getFilter

protected java.lang.String getFilter()
Returns the filter string for the dependency callback

Returns:
the filter string, may be null
Since:
8.0

getTargetClass

protected java.lang.Class<?> getTargetClass()
Returns the target class to actually instantiate

Returns:
the target class, not null
Since:
8.0

setInitializationData

public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement cr,
                                  java.lang.String property,
                                  java.lang.Object data)
                           throws org.eclipse.core.runtime.CoreException
Specified by:
setInitializationData in interface org.eclipse.core.runtime.IExecutableExtension
Throws:
org.eclipse.core.runtime.CoreException

toString

protected java.lang.String toString(java.lang.Object aObj)
Returns a debug version of the object

Parameters:
aObj - the object
Returns:
the debug string
Since:
8.0