|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration
public class AbstractProviderConfiguration
Concrete subclasses can be used to assist in parsing service provider descriptors to filter out and delay loading of service providers that do not apply.
This abstract class contains a set of useful utilities for such concrete subclasses.
Nested Class Summary | |
---|---|
static class |
AbstractProviderConfiguration.ObjectDescriptor
A descriptor for an XML configuration element that identifies a class by name and optionally its methods. |
Field Summary | |
---|---|
protected static java.lang.String |
CLASS
The name of the 'class' XML attribute. |
protected static java.lang.String |
contextParam
the name of the context param |
protected static java.lang.String |
ID
The name of the 'id' XML attribute. |
protected static java.lang.String |
METHOD
The name of the 'method' XML attribute. |
protected static java.lang.String |
NAME
The name of the 'name' XML attribute. |
protected static java.lang.String |
NOT_VALUE
The name of the 'notValue' XML attribute. |
protected static java.lang.String |
NULL
The name of the 'null' XML attribute value. |
protected static java.lang.String |
OBJECT
The name of the 'object' XML attribute. |
protected static java.lang.String |
STATIC_METHOD
The name of the 'method' XML attribute. |
protected static java.lang.String |
VALUE
The name of the 'value' XML attribute. |
Constructor Summary | |
---|---|
AbstractProviderConfiguration()
|
Method Summary | |
---|---|
protected static java.lang.Object |
getAdapter(java.lang.Object object,
java.lang.String className,
java.lang.String pluginId)
Gets an adapter for object to the class described by
className qualified by the optional pluginId . |
protected static java.util.List |
getObjectList(java.lang.String objectsIds,
java.util.Map objectMap,
IConfigurationElement configElement)
A helper method to return a list of objects whose ids are given in a comma-separated string and whose instances are given in an object map. |
protected static org.osgi.framework.Bundle |
getPluginBundle(java.lang.String pluginId)
Given a bundle id, it checks if the bundle is found and activated. |
protected static java.util.Set |
getStrings(java.lang.String s)
Parses the comma-separated s string and returns a set of
the individual entries in the string. |
protected static java.lang.Object |
invokeMethod(org.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration.MethodDescriptor methodDescriptor,
java.lang.Object object)
A utility method to invoke a cascading list of methods. |
protected static java.lang.Object |
invokeStaticMethod(org.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration.StaticMethodDescriptor methodDescriptor,
java.lang.Object object)
A utility method to invoke a cascading list of methods. |
protected static boolean |
isAssignableTo(java.lang.Class clazz,
java.lang.String className)
Tests if the given class is assignable to the given class name. |
protected static java.lang.Class |
loadClass(java.lang.String className,
java.lang.String pluginId)
A utility method to load a class using its name and a given class loader. |
protected static boolean |
objectMatches(java.lang.Object object,
java.util.List objects)
Tests if an object matches at least one in the list of object descriptors passed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String OBJECT
protected static final java.lang.String ID
protected static final java.lang.String CLASS
protected static final java.lang.String METHOD
protected static final java.lang.String STATIC_METHOD
protected static final java.lang.String NAME
protected static final java.lang.String VALUE
protected static final java.lang.String NOT_VALUE
protected static final java.lang.String NULL
protected static final java.lang.String contextParam
Constructor Detail |
---|
public AbstractProviderConfiguration()
Method Detail |
---|
protected static java.util.List getObjectList(java.lang.String objectsIds, java.util.Map objectMap, IConfigurationElement configElement)
objectsIds
- A comma-separated object ids stringobjectMap
- A map of object ids to their instancesconfigElement
- The configuration element, used for error logging
null
if no ids matched any instancesprotected static java.util.Set getStrings(java.lang.String s)
s
string and returns a set of
the individual entries in the string.
s
- A comma-separated string
protected static boolean objectMatches(java.lang.Object object, java.util.List objects)
object
- the object for which to find a matchobjects
- the list of object in which to find a match
true
if there was a match, false
otherwiseprotected static java.lang.Class loadClass(java.lang.String className, java.lang.String pluginId)
className
- The class namebundle
- The class loader
null
if could not be loadedprotected static org.osgi.framework.Bundle getPluginBundle(java.lang.String pluginId)
null
.
pluginId
- the bundle ID
protected static boolean isAssignableTo(java.lang.Class clazz, java.lang.String className)
clazz
- the class to be testedclassName
- the class name to test against
true
if the class is assignable to the class name,
false
otherwise.protected static java.lang.Object getAdapter(java.lang.Object object, java.lang.String className, java.lang.String pluginId)
object
to the class described by
className
qualified by the optional pluginId
.
object
- the object to be adaptedclassName
- the name of the adapter classpluginId
- the optional plugin ID (can be null/code>)
- Returns:
- the adapted object, or
null
if it couldn't be found
protected static java.lang.Object invokeMethod(org.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration.MethodDescriptor methodDescriptor, java.lang.Object object)
methodDescriptor
- the first method descriptorobject
- The object to invoke the method on
protected static java.lang.Object invokeStaticMethod(org.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration.StaticMethodDescriptor methodDescriptor, java.lang.Object object)
StaticMethodDescriptor
- the static method descriptorobject
- The context object to use (it could be null)
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.