Class NullMethod
java.lang.Object
org.jruby.internal.runtime.methods.DynamicMethod
org.jruby.internal.runtime.methods.NullMethod
This class represents a singleton type of method used as a marker for
breaking method lookup loops. Like UndefinedMethod, only one instance is ever created, it
can't be invoked, and shouldn't be returned as though it were a real method.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.internal.runtime.methods.DynamicMethod
DynamicMethod.NativeCall, DynamicMethod.Version
-
Field Summary
FieldsFields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
aliasCount, definedClass, flags, handle, implementationClass, name, protectedClass, serialNumber
-
Method Summary
Modifier and TypeMethodDescriptioncall
(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) The one implementation of call, which throws an exception because NullMethod can't be invoked.dup()
A dummy implementation of dup that just returns the singleton instance.static NullMethod
Retrieve the singleton instance.boolean
isCallableFrom
(IRubyObject caller, CallType callType) NullMethod is always visible because it's only used as a marker to break method lookup loops.void
setCallConfig
(CallConfiguration callConfig) Deprecated.void
setImplementationClass
(RubyModule implClass) Dummy override of setImplementationClass that does nothing.void
setVisibility
(Visibility visibility) Dummy implementation of setVisibility that does nothing.Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
adjustAliasCount, calculateProtectedClass, call, call, call, call, call, call, call, call, call, callRespondTo, getAliasCount, getArity, getCallConfig, getDefinedClass, getHandle, getImplementationClass, getInstanceVariableNames, getMethodData, getName, getProtectedClass, getRealMethod, getSerialNumber, getSignature, getVisibility, init, init, isBuiltin, isImplementedBy, isNative, isNotImplemented, isNull, isRefined, isUndefined, setDefinedClass, setHandle, setIsBuiltin, setNotImplemented, setRuby2Keywords
-
Field Details
-
INSTANCE
-
-
Method Details
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) The one implementation of call, which throws an exception because NullMethod can't be invoked.- Specified by:
call
in classDynamicMethod
- Parameters:
context
- The thread context for the currently executing threadself
- The 'self' or 'receiver' object to use for this callklazz
- The Ruby class against which this method is bindingname
- The incoming name used to invoke this methodargs
- The argument list to this invocationblock
- The block passed to this invocation- Returns:
- The result of the call
- See Also:
-
dup
A dummy implementation of dup that just returns the singleton instance.- Specified by:
dup
in classDynamicMethod
- Returns:
- The singleton instance
-
getInstance
Retrieve the singleton instance.- Returns:
- The singleton instance
-
setImplementationClass
Dummy override of setImplementationClass that does nothing.- Overrides:
setImplementationClass
in classDynamicMethod
- Parameters:
implClass
- Ignored
-
setVisibility
Dummy implementation of setVisibility that does nothing.- Overrides:
setVisibility
in classDynamicMethod
- Parameters:
visibility
- Ignored
-
setCallConfig
Deprecated.Dummy implementation of setCallConfig that does nothing.- Overrides:
setCallConfig
in classDynamicMethod
- Parameters:
callConfig
- Ignored
-
isCallableFrom
NullMethod is always visible because it's only used as a marker to break method lookup loops.- Overrides:
isCallableFrom
in classDynamicMethod
- Parameters:
caller
- The calling objectcallType
- The type of call- Returns:
- true always
-