ClassLoader (Java SE 26 & JDK 26)
- Direct Known Subclasses:
SecureClassLoader
-
Constructor Summary
Constructors
protectedCreates a new class loader using the
ClassLoaderreturned by the methodgetSystemClassLoader()as the parent class loader.protectedCreates a new class loader using the specified parent class loader for delegation.
protectedCreates a new class loader of the specified name and using the specified parent class loader for delegation.
-
Method Summary
voidSets the default assertion status for this class loader to
falseand discards any package defaults or class assertion status settings associated with the class loader.protected final Class<?> defineClass(byte[] b, int off, int len) protected final Class<?> defineClass(String name, byte[] b, int off, int len) Converts an array of bytes into an instance of class
Class.protected final Class<?> Converts an array of bytes into an instance of class
Class, with a givenProtectionDomain.protected final Class<?> Converts a
ByteBufferinto an instance of classClass, with the givenProtectionDomain.Defines a package by name in this
ClassLoader.Finds the class with the specified binary name.
Finds the class with the given binary name in a module defined to this class loader.
Returns the absolute path name of a native library.
protected final Class<?> Returns the class with the given binary name if this loader has been recorded by the Java virtual machine as an initiating loader of a class with that binary name.
protected URLFinds the resource with the given name.
protected URLReturns a URL to a resource in a module defined to this class loader.
Returns an enumeration of
URLobjects representing all the resources with the given name.protected final Class<?> Finds a class with the specified binary name, loading it if necessary.
Returns the lock object for class loading operations.
Returns a
Packageof the given name that has been defined by this class loader.Returns all of the
Packages that have been defined by this class loader.getName()Returns the name of this class loader or
nullif this class loader is not named.Returns all of the
Packages that have been defined by this class loader and its ancestors.Returns the parent class loader for delegation.
Returns the platform class loader.
Finds the resource with the given name.
Returns an input stream for reading the specified resource.
Finds all the resources with the given name.
Returns the system class loader.
Find a resource of the specified name from the search path used to load classes.
Open for reading, a resource of the specified name from the search path used to load classes.
Finds all resources of the specified name from the search path used to load classes.
Returns the unnamed
Modulefor this class loader.final booleanReturns
trueif this class loader is registered as parallel capable, otherwisefalse.Loads the class with the specified binary name.
loadClass(String name, boolean resolve) Loads the class with the specified binary name.
protected static booleanRegisters the caller as parallel capable.
protected final voidLinks the specified class.
Returns a stream whose elements are the URLs of all the resources with the given name.
voidsetClassAssertionStatus(String className, boolean enabled) Sets the desired assertion status for the named top-level class in this class loader and any nested classes contained therein.
voidsetDefaultAssertionStatus(boolean enabled) Sets the default assertion status for this class loader.
voidsetPackageAssertionStatus(String packageName, boolean enabled) Sets the package default assertion status for the named package.
protected final voidSets the signers of a class.
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitCreates and returns a copy of this object.
booleanIndicates whether some other object is "equal to" this one.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.intReturns a hash code value for this object.
final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
Returns a string representation of the object.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
ClassLoader
-
ClassLoader
-
ClassLoader
-
-
Method Details
-
getName
-
loadClass
-
loadClass
-
getClassLoadingLock
-
findClass
-
findClass
-
defineClass
-
defineClass
-
defineClass
-
defineClass
-
resolveClass
-
findSystemClass
-
findLoadedClass
-
setSigners
-
findResource
-
getResource
-
getResources
-
resources
-
findResource
-
findResources
-
registerAsParallelCapable
-
isRegisteredAsParallelCapable
-
getSystemResource
-
getSystemResources
-
getResourceAsStream
-
getSystemResourceAsStream
-
getParent
-
getUnnamedModule
-
getPlatformClassLoader
-
getSystemClassLoader
-
definePackage
-
getDefinedPackage
-
getDefinedPackages
-
getPackage
-
getPackages
-
findLibrary
-
setDefaultAssertionStatus
-
setPackageAssertionStatus
-
setClassAssertionStatus
-
clearAssertionStatus
-