public final class ConstructorCache extends Object
This cache uses weak references to both class loaders and classes, allowing them to be garbage collected when no longer needed. It provides methods to retrieve the zero-argument constructor for a class, based on the current thread's context class loader or the system class loader.
If a class or its zero-argument constructor cannot be found, an empty result is returned.
| Constructor and Description |
|---|
ConstructorCache() |
| Modifier and Type | Method and Description |
|---|---|
Optional<Constructor<?>> |
getConstructor(String className)
Retrieve the zero-argument constructor for the given class name.
|
public Optional<Constructor<?>> getConstructor(String className)
Copyright © 2026. All rights reserved.