Top Description Fields Constructors Methods
org.jruby.anno

public Class IndyBinder

extends AbstractProcessor
Class Inheritance
Annotations
@SupportedAnnotationTypes:JRubyMethod
Imports
org.jruby.compiler.impl.SkinnyMethodAdapter, org.jruby.internal.runtime.methods.DescriptorInfo, org.jruby.runtime.Visibility, org.objectweb.asm.ClassWriter, .Handle, .Opcodes, .Type, org.objectweb.asm.commons.Method, javax.annotation.processing.AbstractProcessor, .RoundEnvironment, .SupportedAnnotationTypes, javax.lang.model.SourceVersion, javax.lang.model.element.ExecutableElement, .Modifier, .NestingKind, .TypeElement, .VariableElement, javax.lang.model.util.ElementFilter, java.io.File, .FileOutputStream, .FileWriter, .IOException, java.util.ArrayList, .Arrays, .Collections, .HashMap, .Iterator, .List, .Map, .Set

Annotation processor for generating "populators" to bind native Java methods as Ruby methods, and to gather a list of classes seen during compilation that should have their invokers regenerated.

Note

This class must ONLY reference classes in the org.jruby.anno package, to avoid forcing a transitive dependency on any runtime JRuby classes.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
private final List<CharSequence>
private static final boolean
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
public static final int
private SkinnyMethodAdapter
public static final String
public static final int
public static final int
public static final int
public static final String
Inherited from javax.annotation.processing.AbstractProcessor:
processingEnv

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
adaptHandle(ExecutableElementDescriptor executableElementDescriptor, int implClass)

private void
private void
private static int
calculateActualRequired(ExecutableElement md, int paramsLength, int optional, boolean rest, boolean isStatic, boolean hasContext, boolean hasBlock)

private static int
calculateHandleOffset(int paramsLength, int required, int optional, boolean rest, boolean isStatic, boolean hasContext, boolean hasBlock)

private void
defineMethodOnClass(int methodVar, int classVar, final String[] names, final String[] aliases, ExecutableElement md)

public void
emitIndexCode(Integer bits, String names, String methodName)

public static long
encodeSignature(int pre, int opt, int post, int kwargs, int requiredKwargs, boolean rest, boolean restKwargs)

public void
private static CharSequence
public static long
public SourceVersion
public boolean
process(Set<? extends TypeElement>
the annotation interfaces requested to be processed
typeElements
,
RoundEnvironment
environment for information about the current and prior round
roundEnvironment
)

Implements abstract javax.annotation.processing.AbstractProcessor.process.

Implements javax.annotation.processing.Processor.process.

Processes a set of annotation interfaces on root elements originating from the prior round and returns whether or not these annotation interfaces are claimed by this processor.

public void
public void
public void
public void
Inherited from javax.annotation.processing.AbstractProcessor:
getCompletionsgetSupportedAnnotationTypesgetSupportedOptionsinitisInitialized

Field Detail

BASEMETHODback to summary
public static final int BASEMETHOD
CLASSback to summary
public static final int CLASS
classNamesback to summary
private final List<CharSequence> classNames
DEBUGback to summary
private static final boolean DEBUG
ENCODE_KWARGS_SHIFTback to summary
private static final int ENCODE_KWARGS_SHIFT
ENCODE_OPT_SHIFTback to summary
private static final int ENCODE_OPT_SHIFT
ENCODE_POST_SHIFTback to summary
private static final int ENCODE_POST_SHIFT
ENCODE_PRE_SHIFTback to summary
private static final int ENCODE_PRE_SHIFT
ENCODE_REQKWARGS_SHIFTback to summary
private static final int ENCODE_REQKWARGS_SHIFT
ENCODE_REST_SHIFTback to summary
private static final int ENCODE_REST_SHIFT
ENCODE_RESTKWARGS_SHIFTback to summary
private static final int ENCODE_RESTKWARGS_SHIFT
MAX_ENCODED_ARGS_EXPONENTback to summary
private static final int MAX_ENCODED_ARGS_EXPONENT
MAX_ENCODED_ARGS_MASKback to summary
private static final int MAX_ENCODED_ARGS_MASK
MODULEMETHODback to summary
public static final int MODULEMETHOD
mvback to summary
private SkinnyMethodAdapter mv
POPULATOR_SUFFIXback to summary
public static final String POPULATOR_SUFFIX
RUBYMODULEback to summary
public static final int RUBYMODULE
RUNTIMEback to summary
public static final int RUNTIME
SINGLETONCLASSback to summary
public static final int SINGLETONCLASS
SRC_GEN_DIRback to summary
public static final String SRC_GEN_DIR

Constructor Detail

IndyBinderback to summary
public IndyBinder()

Method Detail

adaptHandleback to summary
public void adaptHandle(ExecutableElementDescriptor executableElementDescriptor, int implClass)
addCoreMethodMappingback to summary
private void addCoreMethodMapping(TypeElement cls, Map<CharSequence, List<ExecutableElement>> complexNames)
addSimpleMethodMappingsback to summary
private void addSimpleMethodMappings(TypeElement cls, List<ExecutableElement> simpleNames)
calculateActualRequiredback to summary
private static int calculateActualRequired(ExecutableElement md, int paramsLength, int optional, boolean rest, boolean isStatic, boolean hasContext, boolean hasBlock)
calculateHandleOffsetback to summary
private static int calculateHandleOffset(int paramsLength, int required, int optional, boolean rest, boolean isStatic, boolean hasContext, boolean hasBlock)
defineMethodOnClassback to summary
private void defineMethodOnClass(int methodVar, int classVar, final String[] names, final String[] aliases, ExecutableElement md)
emitIndexCodeback to summary
public void emitIndexCode(Integer bits, String names, String methodName)
encodeSignatureback to summary
public static long encodeSignature(int pre, int opt, int post, int kwargs, int requiredKwargs, boolean rest, boolean restKwargs)
generateMethodAddCallsback to summary
public void generateMethodAddCalls(ExecutableElement md, JRubyMethod jrubyMethod)
getActualQualifiedNameback to summary
private static CharSequence getActualQualifiedName(TypeElement td)
getEncodedSignatureback to summary
public static long getEncodedSignature(JRubyMethod anno)
getSupportedSourceVersionback to summary
public SourceVersion getSupportedSourceVersion()

Overrides javax.annotation.processing.AbstractProcessor.getSupportedSourceVersion.

Implements javax.annotation.processing.Processor.getSupportedSourceVersion.

Doc from javax.annotation.processing.AbstractProcessor.getSupportedSourceVersion.

Returns the latest source version supported by this annotation processor.

Returns:SourceVersion

the latest source version supported by this annotation processor

Annotations
@Override
processback to summary
public boolean process(Set<? extends TypeElement> typeElements, RoundEnvironment roundEnvironment)

Implements abstract javax.annotation.processing.AbstractProcessor.process.

Implements javax.annotation.processing.Processor.process.

Doc from javax.annotation.processing.AbstractProcessor.process.

Processes a set of annotation interfaces on root elements originating from the prior round and returns whether or not these annotation interfaces are claimed by this processor. If true is returned, the annotation interfaces are claimed and subsequent processors will not be asked to process them; if false is returned, the annotation interfaces are unclaimed and subsequent processors may be asked to process them. A processor may always return the same boolean value or may vary the result based on its own chosen criteria.

The input set will be empty if the processor supports "*" and the root elements have no annotations. A Processor must gracefully handle an empty set of annotations.

Parameters
typeElements:Set<? extends TypeElement>

the annotation interfaces requested to be processed

roundEnvironment:RoundEnvironment

environment for information about the current and prior round

Returns:boolean

Doc from javax.annotation.processing.Processor.process.

whether or not the set of annotation interfaces are claimed by this processor

Annotations
@Override
processMethodDeclarationback to summary
public void processMethodDeclaration(ExecutableElement method)
processMethodDeclarationMultiback to summary
public void processMethodDeclarationMulti(List<ExecutableElement> methods)
processMethodDeclarationsback to summary
public void processMethodDeclarations(Map<CharSequence, List<ExecutableElement>> declarations)
processTypeback to summary
public void processType(TypeElement cd)
Annotations
@SuppressWarnings:deprecation