public class LegacyInjector extends Object
CodeHacker
(which uses Javassist) to inject method
hooks, which are implemented in the net.imagej.patcher
package.Constructor and Description |
---|
LegacyInjector() |
Modifier and Type | Method and Description |
---|---|
static String |
getImageJ1Version(net.imagej.patcher.CodeHacker hacker)
Determines the ImageJ 1.x version without loading the ImageJ 1.x classes.
|
void |
injectHooks(ClassLoader classLoader)
Overrides class behavior of ImageJ1 classes by injecting method hooks.
|
void |
injectHooks(ClassLoader classLoader,
boolean headless)
Overrides class behavior of ImageJ1 classes by injecting method hooks.
|
static LegacyHooks |
installHooks(ClassLoader classLoader,
LegacyHooks hooks) |
static boolean |
isImageJ1VersionAtLeast(net.imagej.patcher.CodeHacker hacker,
String minimalVersion) |
static void |
preinit() |
static void |
preinit(ClassLoader classLoader) |
static void |
writeJar(File outputJar,
boolean headless,
boolean fullIJJar)
Writes a .jar file with the patched classes.
|
public void injectHooks(ClassLoader classLoader)
classLoader
- the class loader into which to load the patched classespublic static String getImageJ1Version(net.imagej.patcher.CodeHacker hacker)
hacker
- the CodeHacker
instance to usepublic static boolean isImageJ1VersionAtLeast(net.imagej.patcher.CodeHacker hacker, String minimalVersion)
public void injectHooks(ClassLoader classLoader, boolean headless)
classLoader
- the class loader into which to load the patched classesheadless
- whether to include headless patchespublic static void writeJar(File outputJar, boolean headless, boolean fullIJJar) throws ClassNotFoundException, IOException, javassist.NotFoundException
outputJar
- the .jar file to write toheadless
- whether to include the headless patchesfullIJJar
- whether to include unpatched ImageJ 1.x classes and
resources, tooClassNotFoundException
IOException
javassist.NotFoundException
public static void preinit()
public static void preinit(ClassLoader classLoader)
public static LegacyHooks installHooks(ClassLoader classLoader, LegacyHooks hooks) throws UnsupportedOperationException
UnsupportedOperationException
Copyright © 2014–2022 ImageJ. All rights reserved.