|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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(Node rootNode)
Given the root Node in a JRuby AST will locate the name of the
class defined by that AST. |
private static ClassNode |
findClassNode(Node node)
Find the first ClassNode under the supplied Node . |
private static Ruby |
initializeRuntime()
Initializes an instance of the org.jruby.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 JumpException
ClassLoader
.
scriptSource
- the script source textinterfaces
- the interfaces that the scripted Java object is to implement
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
JumpException
- in case of JRuby parsing failureprivate static Ruby initializeRuntime()
org.jruby.Ruby
runtime.
private static java.lang.String findClassName(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 ClassNode findClassNode(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 |