Tree PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD com.ibm.portal.resolver.cor.helper
Class DefaultContentOperationsRegistryFactoryjava.lang.Objectcom.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:
- If the getTargetClass() is overridden, the object tries to instantiate the target class by searching for a constructor that uses dependency injection. Per default this is the constructor that takes a dependency interface, however this can be customized by implementing the getConstructor(Class) method. The dependency interface is then automatically implemented via the ContentOperationsRegistryDependencies.createDependencies(Class, Object, String) callback.
- If the createObject(Class, ContentOperationsRegistryDependencies) method is overridden, the subclass can fully customize the instantiation process.
- 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 contextprotected java.lang.Object createObject(java.lang.Class<?> aClass, ContentOperationsRegistryDependencies aContext)
Method to overrideprotected java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> aClass)
Return the constructor that takes the desired dependency objectprotected java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> aClass, java.lang.Class<?> aDependency)
Return the constructor that takes a particular dependencyprotected java.lang.Object getDependencies()
Return the extra object that is used to resolve dependencies.protected java.lang.String getFilter()
Return the filter string for the dependency callbackprotected java.lang.Class<?> getTargetClass()
Return the target class to actually instantiatevoid setInitializationData(org.eclipse.core.runtime.IConfigurationElement cr, java.lang.String property, java.lang.Object data)
protected java.lang.String toString(java.lang.Object aObj)
Return 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
Tree PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD