jruby/docs BETA
Navigation
org.jruby.embed 16
E AttributeName
I EmbedEvalUnit
I EmbedRubyInstanceConfigAdapter
I EmbedRubyInterfaceAdapter
I EmbedRubyObjectAdapter
I EmbedRubyRuntimeAdapter
C EvalFailedException
A Extension
C InvokeFailedException
C IsolatedScriptingContainer
E LocalContextScope
E LocalVariableBehavior
C ParseFailedException
E PathType
E PropertyName
C ScriptingContainer
EmbedRubyRuntimeAdapter — members 4+
M parse(script, lines) EmbedEvalUnit
M parse(reader, filename, lines) EmbedEvalUnit
M parse(type, filename, lines) EmbedEvalUnit
M parse(istream, filename, lines) EmbedEvalUnit
from RubyRuntimeAdapter
M eval(runtime, script) IRubyObject
M parse(runtime, script, filename, line_number) EvalUnit
M parse(runtime, in, filename, line_number) EvalUnit

org.jruby.embed.EmbedRubyRuntimeAdapter

interface abstract implements RubyRuntimeAdapter 4 members

Wrapper interface of RubyRuntimeAdapter for embedding. This interface defines Java friendly parse methods.

Instance Methods

parse

EmbedEvalUnit parse ( String script, int[] lines )
Java: parse(String script, int[] lines)

Parses a script and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

nametypedescription
scriptStringis a Ruby script to be parsed
linesint[]are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns: an object which can be run

parse

EmbedEvalUnit parse ( Reader reader, String filename, int[] lines )
Java: parse(java.io.Reader reader, String filename, int[] lines)

Parses a script given by a reader and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

nametypedescription
readerjava.io.Readeris used to read a script from
filenameStringis used as in information, for example, appears in a stack trace of an exception
linesint[]are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns: an object which can be run

parse

EmbedEvalUnit parse ( PathType type, String filename, int[] lines )
Java: parse(org.jruby.embed.PathType type, String filename, int[] lines)

Parses a script read from a specified path and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

nametypedescription
typeorg.jruby.embed.PathTypeis one of the types PathType defines
filenameStringis used as in information, for example, appears in a stack trace of an exception
linesint[]are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns: an object which can be run

parse

EmbedEvalUnit parse ( InputStream istream, String filename, int[] lines )
Java: parse(java.io.InputStream istream, String filename, int[] lines)

Parses a script given by a input stream and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

nametypedescription
istreamjava.io.InputStreamis an input stream to get a script from
filenameStringfilename is used as in information, for example, appears in a stack trace of an exception
linesint[]are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns: an object which can be run

Inherited

from RubyRuntimeAdapter

eval

IRubyObject eval ( Ruby runtime, String script )
Java: eval(org.jruby.Ruby runtime, String script)

parse

JavaEmbedUtils.EvalUnit parse ( Ruby runtime, String script, String filename, int line_number )
Java: parse(org.jruby.Ruby runtime, String script, String filename, int lineNumber)

parse

JavaEmbedUtils.EvalUnit parse ( Ruby runtime, InputStream in, String filename, int line_number )
Java: parse(org.jruby.Ruby runtime, java.io.InputStream in, String filename, int lineNumber)