public class PluginWrapper
extends java.lang.Object
Constructor and Description |
---|
PluginWrapper(java.lang.String pluginName,
java.lang.Class<?> pluginClass)
Creates a new instance of the plugin wrapper class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsConstructor(java.lang.Class[] testClasses)
Confirms whether the class represented by this
plugin wrapper object contains a specific constructor
|
java.lang.Object |
create()
Creates a new object the plugin class.
|
java.lang.Object |
create(java.lang.Class[] classes,
java.lang.Object[] data)
Creates a new object the wrapped plugin class
(returns null if unsuccessful).
|
java.lang.Class<?>[] |
getDeclaredClasses()
Wrapper method for getDeclaredClasses -
returns every class declared by the wrapped class
|
java.lang.String |
getName()
Returns the class's name.
|
boolean |
isA(java.lang.Class<?> test)
Used to test inheritance for the plugin class.
|
java.lang.Object |
smethod(java.lang.String name)
Invokes a static method from the plugin.
|
java.lang.Object |
smethod(java.lang.String name,
java.lang.Class[] classes,
java.lang.Object[] parameters)
Invokes a static method from the plugin (returns null if not successful).
|
public PluginWrapper(java.lang.String pluginName, java.lang.Class<?> pluginClass)
pluginName
- the name of the pluginpluginClass
- the instance of the pluginpublic java.lang.Object create()
public java.lang.Object create(java.lang.Class[] classes, java.lang.Object[] data)
classes
- the class types to use when searching for the constructordata
- the data to pass to the plugin's class constructorpublic java.lang.Object smethod(java.lang.String name)
name
- the name of the methodpublic java.lang.Object smethod(java.lang.String name, java.lang.Class[] classes, java.lang.Object[] parameters)
name
- the name of the methodclasses
- the classes for the parametersparameters
- the parameters to usepublic boolean isA(java.lang.Class<?> test)
test
- the class to test inheritance ofpublic java.lang.String getName()
public java.lang.Class<?>[] getDeclaredClasses()
public boolean containsConstructor(java.lang.Class[] testClasses)
testClasses
- The classes of the objects which can be passed
to the constructor.Copyright © 2008-2022 University of Manitoba.