Package org.eclipse.ease.modules
Class ModuleHelper
java.lang.Object
org.eclipse.ease.modules.ModuleHelper
public final class ModuleHelper extends Object
-
Method Summary
Modifier and Type Method Description static List<Field>getFields(Class<?> clazz)Returns a List of exported fields.static Collection<ModuleDefinition>getLoadedModules(IScriptEngine engine)Get all loaded modules for a given script engine.static List<Method>getMethods(Class<?> clazz)Returns a list of exported methods.static List<ICodeFactory.Parameter>getParameters(Method method)static booleanisDeprecated(AccessibleObject element)Check deprecation status of a method/field.static ModuleDefinitionresolveModuleName(String identifier)Resolve a relative module name to its definition.
-
Method Details
-
getMethods
Returns a list of exported methods. Any public method marked by a @WrapToScript annotation is exported. If no annotations are found all public methods are returned.- Parameters:
clazz- class to be evaluated- Returns:
- list of methods
-
getFields
Returns a List of exported fields. Any public final field marked by a @WrapToScript annotation is exported. If no annotations are found all public final fields are returned.- Parameters:
clazz- Class to be evaluated- Returns:
- List of Fields
-
resolveModuleName
Resolve a relative module name to its definition. When only the last part of a module name is provided (without path), this method tries to locate the module and returns its definition. If 2 modules with the same name are detected, aRuntimeExceptionis thrown.- Parameters:
identifier- module identifier- Returns:
- module definition or
nullin case no matching definition is found
-
getLoadedModules
Get all loaded modules for a given script engine.- Parameters:
engine- engine to parse- Returns:
- module definitions for all loaded modules
-
getParameters
-
isDeprecated
Check deprecation status of a method/field.- Parameters:
element- method/field to check- Returns:
truewhen deprecated
-