Top Inners Fields Constructors Methods
org.jruby.javasupport.binding

public Class MethodGatherer

extends Object
Class Inheritance
Imports
com.headius.backport9.modules.Modules, org.jruby.Ruby, .RubyModule, org.jruby.internal.runtime.methods.JavaMethod, org.jruby.java.invokers.ConstructorInvoker, org.jruby.java.util.ClassUtils, org.jruby.javasupport.Java, .JavaSupportImpl, org.jruby.platform.Platform, org.jruby.runtime.Block, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.IdUtil, java.lang.annotation.Annotation, java.lang.reflect.Constructor, .Field, .Method, .Modifier, java.util.ArrayList, .Arrays, .Collections, .HashMap, .HashSet, .List, .Map, .Set, java.util.function.Function, .Predicate

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private static class

Field Summary

Modifier and TypeField and Description
private static final int
private Map<String, ConstantField>
private static final String
private static final boolean
public static final ClassValue<Method[]>
private static final Method[]
private static final ClassValue<MethodGatherer.PartitionedMethods>
private static final ClassValue<MethodGatherer.PartitionedMethods>
private static final Map<String, AssignedName>
private Map<String, NamedInstaller>
private final Map<String, AssignedName>
private static final ClassValue<Class<?>[]>
private static final ClassValue<Boolean>
private static final String
private static final ClassValue<Method[]>
pack-priv final Ruby
private static final Map<String, String>
private static final Map<String, AssignedName>
private Map<String, NamedInstaller>
private final Map<String, AssignedName>

Constructor Summary

AccessConstructor and Description
pack-priv
MethodGatherer(final Ruby runtime, final Class<T> superClass)

Method Summary

Modifier and TypeMethod and Description
private void
protected static void
addField(final Map<K, V> callbacks, final Map<String, AssignedName> names, final Field field, final boolean isFinal, final boolean isStatic)

private static void
addNewMethods(final HashMap<String, List<Method>> nameMethods, final Method[] methods, final boolean removeDuplicate)

private void
private void
public static void
eachAccessibleMethod(final Class<?> javaClass, Predicate<Method[]> classProcessor, Predicate<Method[]> interfaceProcessor)

protected static String
fixScalaNames(final String name)

pack-priv Map<String, NamedInstaller>
pack-priv Map<String, NamedInstaller>
pack-priv static Map<String, List<Method>>
getMethods(final Class<?> javaClass)

pack-priv Map<String, NamedInstaller>
pack-priv Map<String, NamedInstaller>
pack-priv void
initialize(ThreadContext context, Class<?> javaClass, RubyModule proxy)

protected void
protected void
pack-priv void
installConstructors(ThreadContext context, Class<?> javaClass, final RubyModule proxy)

protected void
installInnerClasses(ThreadContext context, final Class<?> javaClass, final RubyModule proxy)

pack-priv void
private boolean
private static boolean
private static Map<String, AssignedName>
newReservedNamesMap(final int size)

protected void
prepareInstanceMethod(Class<?> javaClass, Method method, String name)

protected void
prepareMethod(Class<?> javaClass, Method method, String name, Map<String, NamedInstaller> installers, Map<String, AssignedName> reservedNames, Map<String, AssignedName> names, Function<String, NamedInstaller> constructor)

protected void
prepareStaticMethod(Class<?> javaClass, Method method, String name)

private static boolean
pack-priv void
pack-priv void
setupMethods(Class<?> javaClass)

protected void
setupScalaSingleton(final Class<?> javaClass)

private void
setupSingletonMethods(Map<String, NamedInstaller> methodCallbacks, Class<?> javaClass, Object singleton, Method method, String name)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACC_BRIDGEback to summary
private static final int ACC_BRIDGE
constantFieldsback to summary
private Map<String, ConstantField> constantFields
CONSTRUCTOR_NAMEback to summary
private static final String CONSTRUCTOR_NAME
DEBUG_SCALAback to summary
private static final boolean DEBUG_SCALA
DECLARED_METHODSback to summary
public static final ClassValue<Method[]> DECLARED_METHODS
EMPTY_METHODSback to summary
private static final Method[] EMPTY_METHODS
FILTERED_DECLARED_METHODSback to summary
private static final ClassValue<MethodGatherer.PartitionedMethods> FILTERED_DECLARED_METHODS
FILTERED_METHODSback to summary
private static final ClassValue<MethodGatherer.PartitionedMethods> FILTERED_METHODS
INSTANCE_RESERVED_NAMESback to summary
private static final Map<String, AssignedName> INSTANCE_RESERVED_NAMES
instanceInstallersback to summary
private Map<String, NamedInstaller> instanceInstallers
instanceNamesback to summary
private final Map<String, AssignedName> instanceNames
INTERFACESback to summary
private static final ClassValue<Class<?>[]> INTERFACES
IS_SCALAback to summary
private static final ClassValue<Boolean> IS_SCALA
METHOD_MANGLEback to summary
private static final String METHOD_MANGLE
METHODSback to summary
private static final ClassValue<Method[]> METHODS
runtimeback to summary
pack-priv final Ruby runtime
SCALA_OPERATORSback to summary
private static final Map<String, String> SCALA_OPERATORS
STATIC_RESERVED_NAMESback to summary
private static final Map<String, AssignedName> STATIC_RESERVED_NAMES
staticInstallersback to summary
private Map<String, NamedInstaller> staticInstallers
staticNamesback to summary
private final Map<String, AssignedName> staticNames

Constructor Detail

MethodGathererback to summary
pack-priv MethodGatherer(final Ruby runtime, final Class<T> superClass)

Method Detail

addConstantFieldback to summary
private void addConstantField(Field field)
addFieldback to summary
protected static void addField(final Map<K, V> callbacks, final Map<String, AssignedName> names, final Field field, final boolean isFinal, final boolean isStatic)
addNewMethodsback to summary
private static void addNewMethods(final HashMap<String, List<Method>> nameMethods, final Method[] methods, final boolean removeDuplicate)
assignInstanceAliasesback to summary
private void assignInstanceAliases()
assignStaticAliasesback to summary
private void assignStaticAliases()
eachAccessibleMethodback to summary
public static void eachAccessibleMethod(final Class<?> javaClass, Predicate<Method[]> classProcessor, Predicate<Method[]> interfaceProcessor)
fixScalaNamesback to summary
protected static String fixScalaNames(final String name)
getInstanceInstallersback to summary
pack-priv Map<String, NamedInstaller> getInstanceInstallers()
getInstanceInstallersForWriteback to summary
pack-priv Map<String, NamedInstaller> getInstanceInstallersForWrite()
getMethodsback to summary
pack-priv static Map<String, List<Method>> getMethods(final Class<?> javaClass)
getStaticInstallersback to summary
pack-priv Map<String, NamedInstaller> getStaticInstallers()
getStaticInstallersForWriteback to summary
pack-priv Map<String, NamedInstaller> getStaticInstallersForWrite()
initializeback to summary
pack-priv void initialize(ThreadContext context, Class<?> javaClass, RubyModule proxy)
installClassMethodsback to summary
protected void installClassMethods(ThreadContext context, final RubyModule proxy)
installConstantsback to summary
protected void installConstants(ThreadContext context, final RubyModule proxy)
installConstructorsback to summary
pack-priv void installConstructors(ThreadContext context, Class<?> javaClass, final RubyModule proxy)
installInnerClassesback to summary
protected void installInnerClasses(ThreadContext context, final Class<?> javaClass, final RubyModule proxy)
Annotations
@SuppressWarnings:deprecation
installInstanceMethodsback to summary
pack-priv void installInstanceMethods(ThreadContext context, final RubyModule proxy)
lowerPriorityback to summary
private boolean lowerPriority(String name, Map<String, NamedInstaller> installers, Map<String, AssignedName> names)
methodsAreEquivalentback to summary
private static boolean methodsAreEquivalent(Method child, Method parent)
newReservedNamesMapback to summary
private static Map<String, AssignedName> newReservedNamesMap(final int size)
prepareInstanceMethodback to summary
protected void prepareInstanceMethod(Class<?> javaClass, Method method, String name)
prepareMethodback to summary
protected void prepareMethod(Class<?> javaClass, Method method, String name, Map<String, NamedInstaller> installers, Map<String, AssignedName> reservedNames, Map<String, AssignedName> names, Function<String, NamedInstaller> constructor)
prepareStaticMethodback to summary
protected void prepareStaticMethod(Class<?> javaClass, Method method, String name)
sameTypesAndAccessModifierback to summary
private static boolean sameTypesAndAccessModifier(Method child, Method parent)
setupFieldsAndConstantsback to summary
pack-priv void setupFieldsAndConstants(Class<?> javaClass)
Annotations
@SuppressWarnings:deprecation
setupMethodsback to summary
pack-priv void setupMethods(Class<?> javaClass)
setupScalaSingletonback to summary
protected void setupScalaSingleton(final Class<?> javaClass)
setupSingletonMethodsback to summary
private void setupSingletonMethods(Map<String, NamedInstaller> methodCallbacks, Class<?> javaClass, Object singleton, Method method, String name)
org.jruby.javasupport.binding back to summary

pack-priv Class MethodGatherer.NoConstructorMethod

extends JavaMethod
Class Inheritance

Field Summary

Inherited from org.jruby.internal.runtime.methods.JavaMethod:
BLOCK_METHODSBLOCK_REST_METHODSMETHODSNAME_PASSERnativeCallRESTREST_METHODSsignaturestaticScope

Constructor Summary

AccessConstructor and Description
pack-priv

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
clazz
,
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 minimum 'call' method required for a dynamic method handle.

Inherited from org.jruby.internal.runtime.methods.JavaMethod:
callTracecallTraceCompiledcheckArgumentCountdupgetAritygetCallerRequirementgetJavaNamegetNativeCallgetParameterListgetSignaturegetStaticScopeisNativeisSingletonpostBacktraceAndScopepostBacktraceDummyScopepostBacktraceOnlypostFrameAndScopepostFrameOnlypostNoFrameDummyScopepostNooppostScopeOnlypreBacktraceAndScopepreBacktraceDummyScopepreBacktraceOnlypreFrameAndDummyScopepreFrameAndDummyScopepreFrameAndScopepreFrameAndScopepreFrameOnlypreFrameOnlypreNoFrameDummyScopepreNooppreScopeOnlyraiseArgumentErrorreturnTracereturnTraceCompiledsetAritysetCallerRequirementsetJavaNamesetNativeCallsetNativeCallsetParameterDescsetParameterListsetSignaturesetSingleton

Constructor Detail

NoConstructorMethodback to summary
pack-priv NoConstructorMethod(RubyModule proxy, String name)

Method Detail

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

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

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

The minimum 'call' method required for a dynamic method handle. Subclasses must implement this method, but may implement the other signatures to provide faster, non-boxing call paths. Typically subclasses will implement this method to check variable arity calls, then performing a specific-arity invocation to the appropriate method or performing variable-arity logic in-line.

Parameters
context:ThreadContext

The thread context for the currently executing thread

self:IRubyObject

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

clazz:RubyModule

The Ruby class against which this method is binding

name:String

The incoming name used to invoke this method

args:IRubyObject[]

The argument list to this invocation

block:Block

The block passed to this invocation

Returns:IRubyObject

The result of the call

Annotations
@Override
org.jruby.javasupport.binding back to summary

private Class MethodGatherer.PartitionedMethods

extends Object
Class Inheritance
  • java.lang.Object
  • org.jruby.javasupport.binding.MethodGatherer.PartitionedMethods

Field Summary

Modifier and TypeField and Description
pack-priv final Method[]
pack-priv final Method[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static boolean
filterAccessible(Method method, int mod)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceMethodsback to summary
pack-priv final Method[] instanceMethods
staticMethodsback to summary
pack-priv final Method[] staticMethods

Constructor Detail

PartitionedMethodsback to summary
pack-priv PartitionedMethods(Method[] methods)

Method Detail

filterAccessibleback to summary
private static boolean filterAccessible(Method method, int mod)