Package org.robovm.compiler.plugin.objc
Class ObjCBlockPlugin
java.lang.Object
org.robovm.compiler.plugin.Plugin
org.robovm.compiler.plugin.CompilerPlugin
org.robovm.compiler.plugin.AbstractCompilerPlugin
org.robovm.compiler.plugin.objc.ObjCBlockPlugin
public class ObjCBlockPlugin extends AbstractCompilerPlugin
CompilerPlugin which generates wrapper @Callback methods for @Block
annotated method parameters.-
Field Summary
Fields Modifier and Type Field Description static StringBLOCKstatic StringOBJC_ANNOTATIONS_PACKAGEstatic StringOBJC_PACKAGEstatic StringRUNNABLE_AS_OBJC_BLOCK_MARSHALERstatic StringTYPE_ENCODING -
Constructor Summary
Constructors Constructor Description ObjCBlockPlugin() -
Method Summary
Modifier and Type Method Description voidbeforeClass(Config config, Clazz clazz, ModuleBuilder moduleBuilder)Called just before a class is about to be compiled.protected static soot.SootMethodgetBlockTargetMethod(soot.SootMethod method)protected static soot.SootMethodgetBlockTargetMethod(soot.SootMethod method, int paramIndex)protected StringgetTargetMethodKey(soot.SootMethod targetMethod, soot.Type[] actualTypes, String[][] targetMethodAnnotations)protected static String[][]parseTargetMethodAnnotations(soot.SootMethod m, int paramCount, String value)protected static String[][]parseTargetMethodAnnotations(soot.SootMethod m, String value)protected static Type[]resolveActualTypeArgs(SootClassType offspring, SootClassType base, Type... actualArgs)Resolves the actual generic type arguments for a base class, as viewed from a subclass or implementation.protected static Type[]resolveTargetMethodSignature(soot.SootMethod blockMethod, soot.SootMethod targetMethod, Type blockParamType)Methods inherited from class org.robovm.compiler.plugin.AbstractCompilerPlugin
afterClass, afterClassDependenciesResolved, afterLinker, afterMethod, afterObjectFile, beforeConfig, beforeLinker, beforeMethod, getArguments, helloClassMethods inherited from class org.robovm.compiler.plugin.Plugin
argumentValue, argumentValue, argumentValue, parseArguments
-
Field Details
-
OBJC_PACKAGE
- See Also:
- Constant Field Values
-
OBJC_ANNOTATIONS_PACKAGE
- See Also:
- Constant Field Values
-
BLOCK
- See Also:
- Constant Field Values
-
TYPE_ENCODING
- See Also:
- Constant Field Values
-
RUNNABLE_AS_OBJC_BLOCK_MARSHALER
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ObjCBlockPlugin
public ObjCBlockPlugin()
-
-
Method Details
-
beforeClass
public void beforeClass(Config config, Clazz clazz, ModuleBuilder moduleBuilder) throws IOExceptionDescription copied from class:CompilerPluginCalled just before a class is about to be compiled. Modifications to the underlyingSootClass(Clazz.getSootClass()) should be done at this stage.- Overrides:
beforeClassin classAbstractCompilerPlugin- Parameters:
config- the currentConfig.clazz- theClazzbeing compiled.moduleBuilder- theModuleBuilderholding the generated bitcode.- Throws:
IOException
-
parseTargetMethodAnnotations
-
parseTargetMethodAnnotations
-
getTargetMethodKey
-
getBlockTargetMethod
protected static soot.SootMethod getBlockTargetMethod(soot.SootMethod method, int paramIndex) -
getBlockTargetMethod
protected static soot.SootMethod getBlockTargetMethod(soot.SootMethod method) -
resolveTargetMethodSignature
-
resolveActualTypeArgs
protected static Type[] resolveActualTypeArgs(SootClassType offspring, SootClassType base, Type... actualArgs)Resolves the actual generic type arguments for a base class, as viewed from a subclass or implementation.- Parameters:
offspring- class or interface subclassing or extending the base typebase- base classactualArgs- the actual type arguments passed to the offspring class- Returns:
- actual generic type arguments, must match the type parameters of the offspring class. If omitted, the type parameters will be used instead. This code was copied from http://stackoverflow.com/questions/17297308/how-do-i-resolve-the-actual-type-for-a-generic-return-type-using-reflection and changed slightly.
-