Package org.openrewrite.gradle
Class RewriteClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.openrewrite.gradle.RewriteClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
Rewrite uses jackson for serialization/deserialization. So do lots of other build plugins.
Gradle plugins all share the same classpath at runtime.
This classloader exists to isolate rewrite's use of jackson from the rest of the build.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>Load the named class.protected booleanshouldBeParentLoaded(String name) Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
RewriteClassLoader
-
-
Method Details
-
loadClass
Load the named class. We want classes that extendorg.openrewrite.Recipeto be loaded by this ClassLoader only. But we want classes required to run recipes to continue to be loaded by their parent ClassLoader to avoidClassCastExceptions.- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
shouldBeParentLoaded
-