Package adams.core.scripting
Class AbstractScriptingHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.scripting.AbstractScriptingHandler
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
Dummy
,GroovyHandler
public abstract class AbstractScriptingHandler extends AbstractOptionHandler
Ancestor for all scripting handlers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractScriptingHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Object
invoke(Object o, String methodName, Class[] paramClasses, Object[] paramValues)
Executes the specified method on the current interpreter and returns the result, if any.abstract boolean
isPresent()
Returns whether the handler can be used.abstract Object[]
loadScriptObject(Class cls, PlaceholderFile scriptFile, String scriptOptions, Variables vars)
Loads the scripts object and sets its options.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
isPresent
public abstract boolean isPresent()
Returns whether the handler can be used.- Returns:
- true if available
-
loadScriptObject
public abstract Object[] loadScriptObject(Class cls, PlaceholderFile scriptFile, String scriptOptions, Variables vars)
Loads the scripts object and sets its options.- Parameters:
cls
- the class to instantiatescriptFile
- the external file to loadscriptOptions
- the options to setvars
- the variables to use for expanding- Returns:
- element 0: error messsage (null if ok), element 1: script object
-
invoke
public abstract Object invoke(Object o, String methodName, Class[] paramClasses, Object[] paramValues)
Executes the specified method on the current interpreter and returns the result, if any.- Parameters:
o
- the object the method should be called from, e.g., an InterpretermethodName
- the name of the methodparamClasses
- the classes of the parametersparamValues
- the values of the parameters- Returns:
- the return value of the method, if any (in that case null)
-
-