Package org.mvel2
Class MVELRuntime
java.lang.Object
org.mvel2.MVELRuntime
This class contains the runtime for running compiled MVEL expressions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidReset all the currently registered breakpoints.static Objectexecute(boolean debugger, CompiledExpression expression, Object ctx, VariableResolverFactory variableFactory) Main interpreter.static booleanTests whether or not breakpoints have been declared.static booleanTests whether or not a debugger context exist.static voidregisterBreakpoint(String source, int line) Register a debugger breakpoint.static voidremoveBreakpoint(String source, int line) Remove a specific breakpoint.static voidReset all information registered in the debugger, including the actual attached Debugger and registered breakpoints.static voidsetThreadDebugger(Debugger debugger) Sets the Debugger instance to handle breakpoints.
-
Constructor Details
-
MVELRuntime
public MVELRuntime()
-
-
Method Details
-
execute
public static Object execute(boolean debugger, CompiledExpression expression, Object ctx, VariableResolverFactory variableFactory) Main interpreter.- Parameters:
debugger- Run in debug modeexpression- The compiled expression objectctx- The root context objectvariableFactory- The variable factory to be injected- Returns:
- The resultant value
- See Also:
-
registerBreakpoint
Register a debugger breakpoint.- Parameters:
source- - the source file the breakpoint is registered inline- - the line number of the breakpoint
-
removeBreakpoint
Remove a specific breakpoint.- Parameters:
source- - the source file the breakpoint is registered inline- - the line number of the breakpoint to be removed
-
hasDebuggerContext
public static boolean hasDebuggerContext()Tests whether or not a debugger context exist.- Returns:
- boolean
-
clearAllBreakpoints
public static void clearAllBreakpoints()Reset all the currently registered breakpoints. -
hasBreakpoints
public static boolean hasBreakpoints()Tests whether or not breakpoints have been declared.- Returns:
- boolean
-
setThreadDebugger
Sets the Debugger instance to handle breakpoints. A debugger may only be registered once per thread. Calling this method more than once will result in the second and subsequent calls to simply fail silently. To re-register the Debugger, you must callresetDebugger()- Parameters:
debugger- - debugger instance
-
resetDebugger
public static void resetDebugger()Reset all information registered in the debugger, including the actual attached Debugger and registered breakpoints.
-