|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.portal.resolver.cor.helper.DefaultContentOperationsRegistryFactory
public abstract class DefaultContentOperationsRegistryFactory
Baseclass that can be used to easily implement a
ContentOperationsRegistryFactory
. Implementory typically use this
class in the following ways:
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.createObject(Class, ContentOperationsRegistryDependencies)
method is
overridden, the subclass can fully customize the instantiation process.
createObject(Class, ContentOperationsRegistryDependencies)
,
getTargetClass()
This interface is designed to be implemented by clients. |
Constructor Summary | |
---|---|
DefaultContentOperationsRegistryFactory()
|
Method Summary | ||
---|---|---|
java.lang.Object |
create()
|
|
|
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 |
---|
public DefaultContentOperationsRegistryFactory()
Method Detail |
---|
public java.lang.Object create() throws org.eclipse.core.runtime.CoreException
create
in interface org.eclipse.core.runtime.IExecutableExtensionFactory
org.eclipse.core.runtime.CoreException
public final <T> T create(java.lang.Class<T> cls, ContentOperationsRegistryDependencies ctx) throws org.eclipse.core.runtime.CoreException
ContentOperationsRegistryFactory
create
in interface ContentOperationsRegistryFactory
cls
- the class object of the requested interfacectx
- the context
null
org.eclipse.core.runtime.CoreException
protected java.lang.Object createObject(java.lang.Class<?> aClass, ContentOperationsRegistryDependencies aContext) throws org.eclipse.core.runtime.CoreException
aClass
- class to createaContext
- the context
org.eclipse.core.runtime.CoreException
protected java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> aClass) throws java.lang.NoSuchMethodException
aClass
- the class object, not null
java.lang.NoSuchMethodException
- if a suitable constructor could not be locatedprotected final java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> aClass, java.lang.Class<?> aDependency) throws java.lang.NoSuchMethodException
aClass
- the class object of the target classaDependency
- the dependency interface
null
java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
- if a suitable constructor could not be locatedprotected java.lang.Object getDependencies()
null
protected java.lang.String getFilter()
null
protected java.lang.Class<?> getTargetClass()
null
public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement cr, java.lang.String property, java.lang.Object data) throws org.eclipse.core.runtime.CoreException
setInitializationData
in interface org.eclipse.core.runtime.IExecutableExtension
org.eclipse.core.runtime.CoreException
protected java.lang.String toString(java.lang.Object aObj)
aObj
- the object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |