org.jruby.internal.runtime.methods
Class JavaMethod

java.lang.Object
  extended by org.jruby.internal.runtime.methods.DynamicMethod
      extended by org.jruby.internal.runtime.methods.JavaMethod
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
CompiledMethod, JavaMethod.JavaMethodNBlock, ReflectedJavaMethod, ReflectedJavaMultiMethod, RubyToJavaInvoker

public abstract class JavaMethod
extends DynamicMethod
implements java.lang.Cloneable


Nested Class Summary
static class JavaMethod.JavaMethodN
           
static class JavaMethod.JavaMethodNBlock
           
static class JavaMethod.JavaMethodOne
           
static class JavaMethod.JavaMethodOneBlock
           
static class JavaMethod.JavaMethodOneOrN
           
static class JavaMethod.JavaMethodOneOrNBlock
           
static class JavaMethod.JavaMethodOneOrTwo
           
static class JavaMethod.JavaMethodOneOrTwoBlock
           
static class JavaMethod.JavaMethodOneOrTwoOrN
           
static class JavaMethod.JavaMethodOneOrTwoOrNBlock
           
static class JavaMethod.JavaMethodOneOrTwoOrThree
           
static class JavaMethod.JavaMethodOneOrTwoOrThreeBlock
           
static class JavaMethod.JavaMethodOneOrTwoOrThreeOrN
           
static class JavaMethod.JavaMethodOneOrTwoOrThreeOrNBlock
           
static class JavaMethod.JavaMethodThree
           
static class JavaMethod.JavaMethodThreeBlock
           
static class JavaMethod.JavaMethodThreeOrN
           
static class JavaMethod.JavaMethodThreeOrNBlock
           
static class JavaMethod.JavaMethodTwo
           
static class JavaMethod.JavaMethodTwoBlock
           
static class JavaMethod.JavaMethodTwoOrN
           
static class JavaMethod.JavaMethodTwoOrNBlock
           
static class JavaMethod.JavaMethodTwoOrThree
           
static class JavaMethod.JavaMethodTwoOrThreeBlock
           
static class JavaMethod.JavaMethodTwoOrThreeOrN
           
static class JavaMethod.JavaMethodTwoOrThreeOrNBlock
           
static class JavaMethod.JavaMethodZero
           
static class JavaMethod.JavaMethodZeroBlock
           
static class JavaMethod.JavaMethodZeroOrN
           
static class JavaMethod.JavaMethodZeroOrNBlock
           
static class JavaMethod.JavaMethodZeroOrOne
           
static class JavaMethod.JavaMethodZeroOrOneBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrN
           
static class JavaMethod.JavaMethodZeroOrOneOrNBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrTwo
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrN
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrNBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrThree
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeOrN
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeOrNBlock
           
 
Nested classes/interfaces inherited from class org.jruby.internal.runtime.methods.DynamicMethod
DynamicMethod.NativeCall
 
Field Summary
protected  Arity arity
           
protected  int arityValue
           
static java.lang.Class[][] BLOCK_METHODS
           
static java.lang.Class[][] BLOCK_REST_METHODS
           
static java.lang.Class[][] METHODS
           
static java.lang.Class[][] REST_METHODS
           
protected  StaticScope staticScope
           
 
Fields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
builtin, callConfig, implementationClass, name, nativeCall, notImplemented, protectedClass, serialNumber, visibility
 
Constructor Summary
protected JavaMethod()
           
  JavaMethod(RubyModule implementationClass, Visibility visibility)
           
  JavaMethod(RubyModule implementationClass, Visibility visibility, CallConfiguration callConfig)
           
 
Method Summary
protected  void callTrace(ThreadContext context, boolean enabled, java.lang.String name)
           
protected  void callTraceCompiled(ThreadContext context, boolean enabled, java.lang.String name, java.lang.String file, int line)
           
protected static void checkArgumentCount(JavaMethod method, ThreadContext context, java.lang.String name, IRubyObject[] args, int num)
           
 DynamicMethod dup()
          Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes.
 Arity getArity()
          Retrieve the arity of this method, used for reporting arity to Ruby code.
 java.lang.String getJavaName()
           
 void init(RubyModule implementationClass, Arity arity, Visibility visibility, StaticScope staticScope, CallConfiguration callConfig)
           
 boolean isNative()
          Returns true if this method is backed by native (i.e.
 boolean isSingleton()
           
protected static void postBacktraceAndScope(ThreadContext context)
           
protected static void postBacktraceDummyScope(ThreadContext context)
           
protected static void postBacktraceOnly(ThreadContext context)
           
protected static void postFrameAndScope(ThreadContext context)
           
protected static void postFrameOnly(ThreadContext context)
           
protected static void postNoFrameDummyScope(ThreadContext context)
           
protected static void postNoop(ThreadContext context)
           
protected static void postScopeOnly(ThreadContext context)
           
protected  void preBacktraceAndScope(ThreadContext context, java.lang.String name)
           
protected  void preBacktraceDummyScope(ThreadContext context, java.lang.String name)
           
protected  void preBacktraceOnly(ThreadContext context, java.lang.String name)
           
protected  void preFrameAndDummyScope(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
           
protected  void preFrameAndScope(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
           
protected  void preFrameOnly(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
           
protected  void preNoFrameDummyScope(ThreadContext context)
           
protected  void preNoop()
           
protected  void preScopeOnly(ThreadContext context)
           
protected static IRubyObject raiseArgumentError(JavaMethod method, ThreadContext context, java.lang.String name, int given, int min, int max)
           
protected  void returnTrace(ThreadContext context, boolean enabled, java.lang.String name)
           
protected  void returnTraceCompiled(ThreadContext context, boolean enabled, java.lang.String name)
           
 void setArity(Arity arity)
           
 void setJavaName(java.lang.String javaName)
           
 void setSingleton(boolean isSingleton)
           
 
Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
calculateProtectedClass, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, getCallConfig, getImplementationClass, getName, getNativeCall, getProtectedClass, getRealMethod, getSerialNumber, getVisibility, handleBreak, handleRedo, handleReturn, init, isBuiltin, isCallableFrom, isNotImplemented, isUndefined, setCallConfig, setImplementationClass, setIsBuiltin, setName, setNativeCall, setNotImplemented, setVisibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arityValue

protected int arityValue

arity

protected Arity arity

staticScope

protected StaticScope staticScope

METHODS

public static final java.lang.Class[][] METHODS

REST_METHODS

public static final java.lang.Class[][] REST_METHODS

BLOCK_METHODS

public static final java.lang.Class[][] BLOCK_METHODS

BLOCK_REST_METHODS

public static final java.lang.Class[][] BLOCK_REST_METHODS
Constructor Detail

JavaMethod

public JavaMethod(RubyModule implementationClass,
                  Visibility visibility)

JavaMethod

public JavaMethod(RubyModule implementationClass,
                  Visibility visibility,
                  CallConfiguration callConfig)

JavaMethod

protected JavaMethod()
Method Detail

init

public void init(RubyModule implementationClass,
                 Arity arity,
                 Visibility visibility,
                 StaticScope staticScope,
                 CallConfiguration callConfig)

dup

public DynamicMethod dup()
Description copied from class: DynamicMethod
Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes. It is not required that this method produce a new object if the semantics of the DynamicMethod subtype do not require such.

Specified by:
dup in class DynamicMethod
Returns:
An identical DynamicMethod object to the target.

preFrameAndScope

protected final void preFrameAndScope(ThreadContext context,
                                      IRubyObject self,
                                      java.lang.String name,
                                      Block block)

preFrameAndDummyScope

protected final void preFrameAndDummyScope(ThreadContext context,
                                           IRubyObject self,
                                           java.lang.String name,
                                           Block block)

preFrameOnly

protected final void preFrameOnly(ThreadContext context,
                                  IRubyObject self,
                                  java.lang.String name,
                                  Block block)

preScopeOnly

protected final void preScopeOnly(ThreadContext context)

preNoFrameDummyScope

protected final void preNoFrameDummyScope(ThreadContext context)

preBacktraceOnly

protected final void preBacktraceOnly(ThreadContext context,
                                      java.lang.String name)

preBacktraceDummyScope

protected final void preBacktraceDummyScope(ThreadContext context,
                                            java.lang.String name)

preBacktraceAndScope

protected final void preBacktraceAndScope(ThreadContext context,
                                          java.lang.String name)

preNoop

protected final void preNoop()

postFrameAndScope

protected static final void postFrameAndScope(ThreadContext context)

postFrameOnly

protected static final void postFrameOnly(ThreadContext context)

postScopeOnly

protected static final void postScopeOnly(ThreadContext context)

postNoFrameDummyScope

protected static final void postNoFrameDummyScope(ThreadContext context)

postBacktraceOnly

protected static final void postBacktraceOnly(ThreadContext context)

postBacktraceDummyScope

protected static final void postBacktraceDummyScope(ThreadContext context)

postBacktraceAndScope

protected static final void postBacktraceAndScope(ThreadContext context)

postNoop

protected static final void postNoop(ThreadContext context)

callTrace

protected final void callTrace(ThreadContext context,
                               boolean enabled,
                               java.lang.String name)

returnTrace

protected final void returnTrace(ThreadContext context,
                                 boolean enabled,
                                 java.lang.String name)

callTraceCompiled

protected final void callTraceCompiled(ThreadContext context,
                                       boolean enabled,
                                       java.lang.String name,
                                       java.lang.String file,
                                       int line)

returnTraceCompiled

protected final void returnTraceCompiled(ThreadContext context,
                                         boolean enabled,
                                         java.lang.String name)

setArity

public void setArity(Arity arity)

getArity

public Arity getArity()
Description copied from class: DynamicMethod
Retrieve the arity of this method, used for reporting arity to Ruby code. This arity may or may not reflect the actual specific or variable arities of the referenced method.

Overrides:
getArity in class DynamicMethod
Returns:
The arity of the method, as reported to Ruby consumers.

setJavaName

public void setJavaName(java.lang.String javaName)

getJavaName

public java.lang.String getJavaName()

setSingleton

public void setSingleton(boolean isSingleton)

isSingleton

public boolean isSingleton()

isNative

public boolean isNative()
Description copied from class: DynamicMethod
Returns true if this method is backed by native (i.e. Java) code.

Overrides:
isNative in class DynamicMethod
Returns:
true If backed by Java code or JVM bytecode; false otherwise

raiseArgumentError

protected static IRubyObject raiseArgumentError(JavaMethod method,
                                                ThreadContext context,
                                                java.lang.String name,
                                                int given,
                                                int min,
                                                int max)

checkArgumentCount

protected static void checkArgumentCount(JavaMethod method,
                                         ThreadContext context,
                                         java.lang.String name,
                                         IRubyObject[] args,
                                         int num)


Copyright © 2002-2009 JRuby Team. All Rights Reserved.