Top Description Fields Constructors Methods
org.python.core

pack-priv Class ModuleExposer

extends Exposer
Class Inheritance
Imports
java.lang.invoke.MethodHandles.Lookup, java.lang.reflect.Method, org.python.core.Exposed.PythonMethod, .Exposed.PythonStaticMethod, .ModuleDef.MethodDef, org.python.base.InterpreterError

A ModuleExposer provides access to the attributes of a module defined in Java (a built-in or extension module). These are primarily the MethodDefs derived from annotated methods in the defining class. It is normally obtained by a call to Exposer#exposeModule(Class).

Field Summary

Inherited from org.python.core.Exposer:
methodSpecsspecs

Constructor Summary

AccessConstructor and Description
pack-priv
ModuleExposer()

Construct the ModuleExposer instance for a particular module.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
expose(Class<?>
to scan for definitions
definingClass
)

Build the result from the defining class.

pack-priv ModuleDef.MethodDef[]

Returns:

method definitions
getMethodDefs
(MethodHandles.Lookup
authorisation to access methods
lookup
)

From the methods discovered by introspection of the class, return an array of MethodDefs.

pack-priv ScopeKind
kind()

Implements abstract org.python.core.Exposer.kind.

pack-priv void
scanJavaMethods(Class<?>
to introspect for definitions
definingClass
)

Overrides org.python.core.Exposer.scanJavaMethods.

For a Python module defined in Java, add to specs, the methods found in the given defining class and annotated for exposure.
Inherited from org.python.core.Exposer:
addMethodSpecaddSpecaddStaticMethodSpecduplicateErrorexposeModuleexposeTypesuperClasses

Constructor Detail

ModuleExposerback to summary
pack-priv ModuleExposer()

Construct the ModuleExposer instance for a particular module.

Method Detail

exposeback to summary
pack-priv void expose(Class<?> definingClass)

Build the result from the defining class.

Parameters
definingClass:Class<?>

to scan for definitions

getMethodDefsback to summary
pack-priv ModuleDef.MethodDef[] getMethodDefs(MethodHandles.Lookup lookup) throws InterpreterError

From the methods discovered by introspection of the class, return an array of MethodDefs. This array will normally be part of a ModuleDef from which the dictionary of each instance of the module will be created. A MethodDef relies on MethodHandle, so a lookup object must be provided with the necessary access to the defining class.

Parameters
lookup:MethodHandles.Lookup

authorisation to access methods

Returns:ModuleDef.MethodDef[]

method definitions

Exceptions
InterpreterError:
on lookup prohibited
kindback to summary
pack-priv ScopeKind kind()

Implements abstract org.python.core.Exposer.kind.

Returns:ScopeKind

Doc from org.python.core.Exposer.kind.

which ScopeKind of Exposer is this?

Annotations
@Override
scanJavaMethodsback to summary
pack-priv void scanJavaMethods(Class<?> definingClass) throws InterpreterError

Overrides org.python.core.Exposer.scanJavaMethods.

For a Python module defined in Java, add to specs, the methods found in the given defining class and annotated for exposure.

Parameters
definingClass:Class<?>

to introspect for definitions

Annotations
@Override
Exceptions
InterpreterError:
on duplicates or unsupported types