Top Description Fields Constructors Methods
org.jruby.internal.runtime.methods

public Class NullMethod

extends DynamicMethod
Class Inheritance
Imports
org.jruby.RubyModule, org.jruby.runtime.Block, .CallType, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject

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.

Field Summary

Modifier and TypeField and Description
public static final NullMethod
Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
aliasCountdefinedClassflagshandleimplementationClassnameprotectedClassserialNumber

Constructor Summary

AccessConstructor and Description
private
NullMethod()

Constructor for the one NullMethod instance.

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
call(ThreadContext
The thread context for the currently executing thread
context
,
IRubyObject
The 'self' or 'receiver' object to use for this call
self
,
RubyModule
The Ruby class against which this method is binding
klazz
,
String
The incoming name used to invoke this method
name
,
IRubyObject[]
The argument list to this invocation
args
,
Block
The block passed to this invocation
block
)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

The one implementation of call, which throws an exception because NullMethod can't be invoked.

public DynamicMethod

Returns:

The singleton instance
dup
()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

A dummy implementation of dup that just returns the singleton instance.

public static NullMethod

Returns:

The singleton instance
getInstance
()

Retrieve the singleton instance.

public boolean

Returns:

true always
isCallableFrom
(IRubyObject
The calling object
caller
,
CallType
The type of call
callType
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isCallableFrom.

NullMethod is always visible because it's only used as a marker to break method lookup loops.

public void
setCallConfig(CallConfiguration
Ignored
callConfig
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setCallConfig.

Deprecated

Dummy implementation of setCallConfig that does nothing.

public void
setImplementationClass(RubyModule
Ignored
implClass
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setImplementationClass.

Dummy override of setImplementationClass that does nothing.

public void
setVisibility(Visibility
Ignored
visibility
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setVisibility.

Dummy implementation of setVisibility that does nothing.

Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
adjustAliasCountcalculateProtectedClasscallcallcallcallcallcallcallcallcallcallRespondTogetAliasCountgetAritygetCallConfiggetDefinedClassgetHandlegetImplementationClassgetInstanceVariableNamesgetMethodDatagetNamegetProtectedClassgetRealMethodgetSerialNumbergetSignaturegetVisibilityinitinitisBuiltinisImplementedByisNativeisNotImplementedisNullisRefinedisUndefinedsetDefinedClasssetHandlesetIsBuiltinsetNotImplementedsetRuby2Keywords

Field Detail

INSTANCEback to summary
public static final NullMethod INSTANCE

Constructor Detail

NullMethodback to summary
private NullMethod()

Constructor for the one NullMethod instance.

Method Detail

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

The one implementation of call, which throws an exception because NullMethod can't be invoked.

Parameters
context:ThreadContext

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The thread context for the currently executing thread

self:IRubyObject

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The 'self' or 'receiver' object to use for this call

klazz:RubyModule

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The Ruby class against which this method is binding

name:String

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The incoming name used to invoke this method

args:IRubyObject[]

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The argument list to this invocation

block:Block

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The block passed to this invocation

Returns:IRubyObject

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The result of the call

See Also
org.jruby.internal.runtime.methods.DynamicMethod#call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject[])
dupback to summary
public DynamicMethod dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

A dummy implementation of dup that just returns the singleton instance.

Returns:DynamicMethod

The singleton instance

getInstanceback to summary
public static NullMethod getInstance()

Retrieve the singleton instance.

Returns:NullMethod

The singleton instance

isCallableFromback to summary
public boolean isCallableFrom(IRubyObject caller, CallType callType)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isCallableFrom.

NullMethod is always visible because it's only used as a marker to break method lookup loops.

Parameters
caller:IRubyObject

The calling object

callType:CallType

The type of call

Returns:boolean

true always

Annotations
@Override
setCallConfigback to summary
public void setCallConfig(CallConfiguration callConfig)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setCallConfig.

Deprecated

Dummy implementation of setCallConfig that does nothing.

Parameters
callConfig:CallConfiguration

Ignored

Annotations
@Override
@Deprecated
setImplementationClassback to summary
public void setImplementationClass(RubyModule implClass)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setImplementationClass.

Dummy override of setImplementationClass that does nothing.

Parameters
implClass:RubyModule

Ignored

Annotations
@Override
setVisibilityback to summary
public void setVisibility(Visibility visibility)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setVisibility.

Dummy implementation of setVisibility that does nothing.

Parameters
visibility:Visibility

Ignored

Annotations
@Override