Annotation Interface Patches


@Retention(RUNTIME) @Target(TYPE) public @interface Patches
Classes with this annotation will be set up to patch a different class. Name your patch like your target class (including the package) and make sure this class is loaded before the target. Do not patch classes that are backed by a DB: the modifications that they will be subjected to might confuse an ORM and lead to data loss.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Overrides the default classpath that contains the target and dependencies.
    boolean
    Disables safety checks.
    boolean
    Controls whether the target class' methods and fiel will all be set to public to facilitate more comprehensive overriding.
    boolean
    Controls whether we will try to preserve the original super class using bytecode magic.
    A comma separated list of annotations to remove from the target class before loading.
    Deprecated.
    Do not use.
  • Element Details

    • classPath

      String classPath
      Overrides the default classpath that contains the target and dependencies.
      Returns:
      The class path.
      Default:
      ""
    • target

      Deprecated.
      Do not use. Use the same name and package as your target instead.
      Can be used to set the target class if yours has a different name.
      Returns:
      The target class.
      Default:
      ""
    • makePublic

      boolean makePublic
      Controls whether the target class' methods and fiel will all be set to public to facilitate more comprehensive overriding.
      Returns:
      The public flag.
      Default:
      true
    • stripAnnotations

      String stripAnnotations
      A comma separated list of annotations to remove from the target class before loading.
      Returns:
      The strip annotations flag.
      Default:
      ""
    • preserveSuper

      boolean preserveSuper
      Controls whether we will try to preserve the original super class using bytecode magic.
      Returns:
      The preserve super flag.
      Default:
      true
    • force

      boolean force
      Disables safety checks. Use this at your own risk and not in production.
      Returns:
      The force flag.
      Default:
      false