Class RunScript
Object
RunScript
Can run javascript source code. The methods call specific javascript
functions in the source code.
- Author:
- maartenl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Runs a specific function called "function event()".boolean
Runs a specific function called "function event(person)".Runs a specific function called "function command(person, command)".boolean
Runs a specific function called "function event(room)".
-
Constructor Details
-
RunScript
-
-
Method Details
-
run
public DisplayInterface run(Person person, String command, String sourceCode) throws ScriptException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException Runs a specific function called "function command(person, command)".Basically it calls a specific deputy defined "command".
- Parameters:
person
- the person issuing forth the command.command
- the command, a string.sourceCode
- the source code, javascript, a string.- Returns:
- false if failed, true if successful
- Throws:
ScriptException
- if an error occurred in the javascriptNoSuchMethodException
- if the function cannot be found,IllegalAccessException
InstantiationException
InvocationTargetException
-
run
public boolean run(Person person, String sourceCode) throws ScriptException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException Runs a specific function called "function event(person)".Basically it calls a specific deputy defined "event".
- Parameters:
person
- the event needs to be executed with this person as the focus.sourceCode
- the source code, javascript, a string.- Returns:
- false if failed, true if successful
- Throws:
ScriptException
- if an error occurred in the javascriptNoSuchMethodException
- if the function cannot be found,IllegalAccessException
InstantiationException
InvocationTargetException
-
run
public boolean run(Room room, String sourceCode) throws ScriptException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException Runs a specific function called "function event(room)".Basically it calls a specific deputy defined "event".
- Parameters:
room
- the event needs to be executed with this room as the focus.sourceCode
- the source code, javascript, a string.- Returns:
- false if failed, true if successful
- Throws:
ScriptException
- if an error occurred in the javascriptNoSuchMethodException
- if the function cannot be found,IllegalAccessException
InstantiationException
InvocationTargetException
-
run
public boolean run(String sourceCode) throws ScriptException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException Runs a specific function called "function event()". This is a generic event without a focus.- Parameters:
sourceCode
- the source code, javascript, a string.- Returns:
- false if failed, true if successful
- Throws:
ScriptException
- if an error occurred in the javascriptNoSuchMethodException
- if the function cannot be found,IllegalAccessException
InstantiationException
InvocationTargetException
-