public class ClassAliasPool extends Object implements ClassLookup
| Modifier and Type | Field and Description |
|---|---|
static ClassAliasPool |
CLASS_ALIASES |
| Modifier and Type | Method and Description |
|---|---|
static void |
a(Class<?>... classes) |
static void |
a(Class<?> clazz)
Always throws an AssertionError for the given class.
|
void |
addAlias(Class<?>... classes)
Registers the provided classes using their simple names as aliases.
|
void |
addAlias(Class<?> clazz,
@NotNull String names)
Registers a class with one or more explicit aliases.
|
CharSequence |
applyAlias(CharSequence name)
Applies an alias if one has been registered for the given name.
|
void |
clean()
Removes classes from the lookup which are not loaded by the default class loaders.
|
@NotNull Class<?> |
forName(@NotNull CharSequence name)
Looks up a class using its name or registered alias.
|
String |
nameFor(Class<?> clazz)
Returns the primary alias for a given class.
|
void |
removePackage(String pkgName)
Removes all aliases from the given package.
|
void |
resetResolutionFailures()
Clears any cached lookup failures so a subsequent search can retry.
|
protected static boolean |
testPackage(String pkgName,
Class<?> clazz) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrap, wrappublic static final ClassAliasPool CLASS_ALIASES
public static void a(Class<?> clazz)
clazz - the class used to produce the errorAssertionError - always thrownpublic void clean()
@NotNull public @NotNull Class<?> forName(@NotNull @NotNull CharSequence name) throws ClassNotFoundRuntimeException
forName in interface ClassLookupname - the class name or aliasClassNotFoundRuntimeException - if the class cannot be foundpublic void resetResolutionFailures()
public String nameFor(Class<?> clazz) throws IllegalArgumentException
nameFor in interface ClassLookupclazz - the class to queryIllegalArgumentException - if the class represents a lambdapublic void removePackage(String pkgName)
pkgName - the package prefix to removepublic void addAlias(@NotNull
Class<?>... classes)
addAlias in interface ClassLookupclasses - the classes to registerpublic void addAlias(Class<?> clazz, @NotNull @NotNull String names)
addAlias in interface ClassLookupclazz - the class to registernames - comma separated list of aliasespublic CharSequence applyAlias(CharSequence name)
applyAlias in interface ClassLookupname - the original class name or aliasfor how aliases are added to the pool.public static void a(Class<?>... classes)
Copyright © 2026 Chronicle Software Ltd. All rights reserved.