Class Patcher

java.lang.Object
org.qbicc.plugin.patcher.Patcher

public class Patcher extends Object
  • Method Details

    • get

      public static Patcher get(CompilationContext ctxt)
    • initialize

      public static void initialize(ClassContext classContext)
    • getTypeBuilder

      public static DefinedTypeDefinition.Builder getTypeBuilder(ClassContext classContext, DefinedTypeDefinition.Builder delegate)
    • addField

      public void addField(ClassContext classContext, String internalName, String fieldName, TypeDescriptor descriptor, FieldResolver resolver, int index, int addModifiers)
      Add a field to the given class. The field is not defined until the class is first loaded. The field may be a build time field or a run time field (I_ACC_RUN_TIME). An initializer may be given for static fields, but it must be a run time initializer, even if the field is a build time field. Initializers are ignored for instance fields.
      Parameters:
      classContext - the class context of the class (must not be null)
      internalName - the name of the class (must not be null)
      fieldName - the name of the field (must not be null)
      descriptor - the field descriptor (must not be null)
      resolver - the resolver for the added field (must not be null)
      index - the index of the added field to pass to the resolver
      addModifiers - modifiers to add, if any
    • deleteField

      public void deleteField(ClassContext classContext, String internalName, String fieldName, TypeDescriptor descriptor)
      Delete a field.
      Parameters:
      classContext - the class context of the class (must not be null)
      internalName - the name of the class (must not be null)
      fieldName - the name of the field (must not be null)
      descriptor - the field descriptor (must not be null)
    • replaceField

      public void replaceField(ClassContext classContext, String internalName, String fieldName, TypeDescriptor descriptor, FieldResolver resolver, int index, int addModifiers)
      Add a field to the given class. The field is not defined until the class is first loaded. The field may be a build time field or a run time field (I_ACC_RUN_TIME). An initializer may be given for static fields, but it must be a run time initializer, even if the field is a build time field. Initializers are ignored for instance fields.
      Parameters:
      classContext - the class context of the class (must not be null)
      internalName - the name of the class (must not be null)
      fieldName - the name of the field (must not be null)
      descriptor - the field descriptor (must not be null)
      resolver - the resolver for the added field (must not be null)
      index - the index of the added field to pass to the resolver
      addModifiers - modifiers to add, if any
    • addConstructor

      public void addConstructor(ClassContext classContext, String internalName, MethodDescriptor descriptor, ConstructorResolver resolver, int index, int addModifiers)
    • deleteConstructor

      public void deleteConstructor(ClassContext classContext, String internalName, MethodDescriptor descriptor)
    • replaceConstructor

      public void replaceConstructor(ClassContext classContext, String internalName, MethodDescriptor descriptor, ConstructorResolver resolver, int index, int addModifiers)
    • addMethod

      public void addMethod(ClassContext classContext, String internalName, String methodName, MethodDescriptor descriptor, MethodResolver resolver, int index, int addModifiers)
    • deleteMethod

      public void deleteMethod(ClassContext classContext, String internalName, String methodName, MethodDescriptor descriptor)
    • replaceMethod

      public void replaceMethod(ClassContext classContext, String internalName, String methodName, MethodDescriptor descriptor, MethodResolver resolver, int index, int addModifiers)