|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.scripting.jruby.JRubyScriptUtils
public abstract class JRubyScriptUtils
Utility methods for handling JRuby-scripted objects.
As of Spring 3.0, this class requires JRuby 1.1 or higher.
| Nested Class Summary | |
|---|---|
static class |
JRubyScriptUtils.JRubyExecutionException
Exception thrown in response to a JRuby RaiseException
being thrown from a JRuby method invocation. |
private static class |
JRubyScriptUtils.RubyObjectInvocationHandler
InvocationHandler that invokes a JRuby script method. |
| Constructor Summary | |
|---|---|
JRubyScriptUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.Object |
createJRubyObject(java.lang.String scriptSource,
java.lang.Class[] interfaces)
Create a new JRuby-scripted object from the given script source, using the default ClassLoader. |
static java.lang.Object |
createJRubyObject(java.lang.String scriptSource,
java.lang.Class[] interfaces,
java.lang.ClassLoader classLoader)
Create a new JRuby-scripted object from the given script source. |
private static java.lang.String |
findClassName(org.jruby.ast.Node rootNode)
Given the root Node in a JRuby AST will locate the name of the
class defined by that AST. |
private static org.jruby.ast.ClassNode |
findClassNode(org.jruby.ast.Node node)
Find the first ClassNode under the supplied Node. |
private static org.jruby.Ruby |
initializeRuntime()
Initializes an instance of the Ruby runtime. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JRubyScriptUtils()
| Method Detail |
|---|
public static java.lang.Object createJRubyObject(java.lang.String scriptSource,
java.lang.Class[] interfaces)
throws org.jruby.exceptions.JumpException
ClassLoader.
scriptSource - the script source textinterfaces - the interfaces that the scripted Java object is to implement
org.jruby.exceptions.JumpException - in case of JRuby parsing failureClassUtils.getDefaultClassLoader()
public static java.lang.Object createJRubyObject(java.lang.String scriptSource,
java.lang.Class[] interfaces,
java.lang.ClassLoader classLoader)
scriptSource - the script source textinterfaces - the interfaces that the scripted Java object is to implementclassLoader - the ClassLoader to create the script proxy with
org.jruby.exceptions.JumpException - in case of JRuby parsing failureprivate static org.jruby.Ruby initializeRuntime()
Ruby runtime.
private static java.lang.String findClassName(org.jruby.ast.Node rootNode)
Node in a JRuby AST will locate the name of the
class defined by that AST.
java.lang.IllegalArgumentException - if no class is defined by the supplied ASTprivate static org.jruby.ast.ClassNode findClassNode(org.jruby.ast.Node node)
ClassNode under the supplied Node.
ClassNode, or null
if no ClassNode is found
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||