Class ObjCBlockPlugin


public class ObjCBlockPlugin
extends AbstractCompilerPlugin
CompilerPlugin which generates wrapper @Callback methods for @Block annotated method parameters.
  • Field Details

  • Constructor Details

    • ObjCBlockPlugin

      public ObjCBlockPlugin()
  • Method Details

    • beforeClass

      public void beforeClass​(Config config, Clazz clazz, ModuleBuilder moduleBuilder) throws IOException
      Description copied from class: CompilerPlugin
      Called just before a class is about to be compiled. Modifications to the underlying SootClass (Clazz.getSootClass()) should be done at this stage.
      Overrides:
      beforeClass in class AbstractCompilerPlugin
      Parameters:
      config - the current Config.
      clazz - the Clazz being compiled.
      moduleBuilder - the ModuleBuilder holding the generated bitcode.
      Throws:
      IOException
    • parseTargetMethodAnnotations

      protected static String[][] parseTargetMethodAnnotations​(soot.SootMethod m, String value)
    • parseTargetMethodAnnotations

      protected static String[][] parseTargetMethodAnnotations​(soot.SootMethod m, int paramCount, String value)
    • getTargetMethodKey

      protected String getTargetMethodKey​(soot.SootMethod targetMethod, soot.Type[] actualTypes, String[][] targetMethodAnnotations)
    • getBlockTargetMethod

      protected static soot.SootMethod getBlockTargetMethod​(soot.SootMethod method, int paramIndex)
    • getBlockTargetMethod

      protected static soot.SootMethod getBlockTargetMethod​(soot.SootMethod method)
    • resolveTargetMethodSignature

      protected static Type[] resolveTargetMethodSignature​(soot.SootMethod blockMethod, soot.SootMethod targetMethod, Type blockParamType)
    • 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 type
      base - base class
      actualArgs - 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.