Package org.jruby.javasupport
Class Java.JCreateMethod
- All Implemented Interfaces:
Cloneable
,MethodArgs2
,NativeCallMethod
,CallableSelector.CallableCache<JavaProxyConstructor>
- Enclosing class:
Java
public static class Java.JCreateMethod
extends JavaMethod.JavaMethodN
implements CallableSelector.CallableCache<JavaProxyConstructor>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.internal.runtime.methods.JavaMethod
JavaMethod.JavaMethodN, JavaMethod.JavaMethodNBlock, JavaMethod.JavaMethodOne, JavaMethod.JavaMethodOneBlock, JavaMethod.JavaMethodOneOrN, JavaMethod.JavaMethodOneOrNBlock, JavaMethod.JavaMethodOneOrTwo, JavaMethod.JavaMethodOneOrTwoBlock, JavaMethod.JavaMethodOneOrTwoOrN, JavaMethod.JavaMethodOneOrTwoOrNBlock, JavaMethod.JavaMethodOneOrTwoOrThree, JavaMethod.JavaMethodOneOrTwoOrThreeBlock, JavaMethod.JavaMethodOneOrTwoOrThreeOrN, JavaMethod.JavaMethodOneOrTwoOrThreeOrNBlock, JavaMethod.JavaMethodThree, JavaMethod.JavaMethodThreeBlock, JavaMethod.JavaMethodThreeOrN, JavaMethod.JavaMethodThreeOrNBlock, JavaMethod.JavaMethodTwo, JavaMethod.JavaMethodTwoBlock, JavaMethod.JavaMethodTwoOrN, JavaMethod.JavaMethodTwoOrNBlock, JavaMethod.JavaMethodTwoOrThree, JavaMethod.JavaMethodTwoOrThreeBlock, JavaMethod.JavaMethodTwoOrThreeOrN, JavaMethod.JavaMethodTwoOrThreeOrNBlock, JavaMethod.JavaMethodZero, JavaMethod.JavaMethodZeroBlock, JavaMethod.JavaMethodZeroOrN, JavaMethod.JavaMethodZeroOrNBlock, JavaMethod.JavaMethodZeroOrOne, JavaMethod.JavaMethodZeroOrOneBlock, JavaMethod.JavaMethodZeroOrOneOrN, JavaMethod.JavaMethodZeroOrOneOrNBlock, JavaMethod.JavaMethodZeroOrOneOrTwo, JavaMethod.JavaMethodZeroOrOneOrTwoBlock, JavaMethod.JavaMethodZeroOrOneOrTwoOrN, JavaMethod.JavaMethodZeroOrOneOrTwoOrNBlock, JavaMethod.JavaMethodZeroOrOneOrTwoOrThree, JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeBlock, JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeOrN, JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeOrNBlock
Nested classes/interfaces inherited from class org.jruby.internal.runtime.methods.DynamicMethod
DynamicMethod.NativeCall, DynamicMethod.Version
-
Field Summary
Fields inherited from class org.jruby.internal.runtime.methods.JavaMethod
BLOCK_METHODS, BLOCK_REST_METHODS, METHODS, NAME_PASSER, nativeCall, REST, REST_METHODS, signature, staticScope
Fields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
aliasCount, definedClass, flags, handle, implementationClass, name, protectedClass, serialNumber
-
Method Summary
Modifier and TypeMethodDescriptionfinal IRubyObject
call
(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) final IRubyObject
call
(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args) A default implementation of n-arity, non-block 'call' method, which simply calls the n-arity, block-receiving version with the arg list and Block.NULL_BLOCK.final IRubyObject
call
(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block) static int
forTypes
(Ruby runtime, IRubyObject[] args, Java.JCtorCache cache) Disambiguate which ctor index to call from the given cachefinal JavaProxyConstructor
getSignature
(int signatureCode) matchConstructor
(ThreadContext context, JavaProxyConstructor[] constructors, int arity, IRubyObject... args) static <T extends ParameterTypes>
TmatchConstructorIndex
(ThreadContext context, T[] constructors, CallableSelector.CallableCache<ParameterTypes> cache, int arity, IRubyObject... args) final void
putSignature
(int signatureCode, JavaProxyConstructor callable) Methods inherited from class org.jruby.internal.runtime.methods.JavaMethod.JavaMethodN
call, call, call
Methods inherited from class org.jruby.internal.runtime.methods.JavaMethod
callTrace, callTraceCompiled, checkArgumentCount, dup, getArity, getCallerRequirement, getJavaName, getNativeCall, getParameterList, getSignature, getStaticScope, isNative, isSingleton, postBacktraceAndScope, postBacktraceDummyScope, postBacktraceOnly, postFrameAndScope, postFrameOnly, postNoFrameDummyScope, postNoop, postScopeOnly, preBacktraceAndScope, preBacktraceDummyScope, preBacktraceOnly, preFrameAndDummyScope, preFrameAndDummyScope, preFrameAndScope, preFrameAndScope, preFrameOnly, preFrameOnly, preNoFrameDummyScope, preNoop, preScopeOnly, raiseArgumentError, returnTrace, returnTraceCompiled, setArity, setCallerRequirement, setJavaName, setNativeCall, setNativeCall, setParameterDesc, setParameterList, setSignature, setSingleton
Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
adjustAliasCount, calculateProtectedClass, call, call, call, call, callRespondTo, getAliasCount, getCallConfig, getDefinedClass, getHandle, getImplementationClass, getInstanceVariableNames, getMethodData, getName, getProtectedClass, getRealMethod, getSerialNumber, getVisibility, init, init, isBuiltin, isCallableFrom, isImplementedBy, isNotImplemented, isNull, isRefined, isUndefined, setCallConfig, setDefinedClass, setHandle, setImplementationClass, setIsBuiltin, setNotImplemented, setRuby2Keywords, setVisibility
-
Method Details
-
forTypes
Disambiguate which ctor index to call from the given cache- Parameters:
runtime
-args
- argument list for the ctorscache
- cache of ctors- Returns:
- Index of ctor in cache to call, or throws a new exception
-
call
public final IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) - Overrides:
call
in classJavaMethod.JavaMethodN
-
call
public final IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block) - Overrides:
call
in classJavaMethod.JavaMethodN
-
call
public final IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args) Description copied from class:DynamicMethod
A default implementation of n-arity, non-block 'call' method, which simply calls the n-arity, block-receiving version with the arg list and Block.NULL_BLOCK.- Specified by:
call
in classJavaMethod.JavaMethodN
- Parameters:
context
- The thread context for the currently executing threadself
- The 'self' or 'receiver' object to use for this callclazz
- The Ruby class against which this method is bindingname
- The incoming name used to invoke this methodargs
- The first argument to this invocation- Returns:
- The result of the call
-
matchConstructor
public JavaProxyConstructor matchConstructor(ThreadContext context, JavaProxyConstructor[] constructors, int arity, IRubyObject... args) -
matchConstructorIndex
public static <T extends ParameterTypes> T matchConstructorIndex(ThreadContext context, T[] constructors, CallableSelector.CallableCache<ParameterTypes> cache, int arity, IRubyObject... args) -
getSignature
- Specified by:
getSignature
in interfaceCallableSelector.CallableCache<JavaProxyConstructor>
-
putSignature
- Specified by:
putSignature
in interfaceCallableSelector.CallableCache<JavaProxyConstructor>
-