public class ClassAliases
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ClassAliases.ClassFilter |
Constructor and Description |
---|
ClassAliases() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addAlias(java.lang.String alias,
java.lang.Class<?> cls) |
static boolean |
addAlias(java.lang.String alias,
java.lang.String className) |
static void |
addPackageAliases(java.lang.String pkgName,
java.lang.String regex,
java.lang.Class<?> T)
Searches for the subclasses of T within a specified package whose full
name match the specified regular expression, and adds them to the alias
table, using their simple names as a key.
|
static java.lang.String |
getAlias(java.lang.Class<?> cls) |
static java.lang.String |
getAliasOrName(java.lang.Class<?> cls) |
static ClassAliases.ClassFilter |
getClassFilter() |
static boolean |
isClassValid(java.lang.Class<?> cls) |
static <C> boolean |
isClassValid(java.lang.Object comp)
Checks a component to see if its class is valid according to any class
filter which has been set.
|
static void |
main(java.lang.String[] args) |
static java.lang.Object |
newInstance(java.lang.String classId,
java.lang.Class<?> superclass) |
static java.lang.Object |
newInstance(java.lang.String classId,
java.lang.Class<?> superclass,
java.lang.Class<?>[] argTypes,
java.lang.Object[] args) |
static java.lang.Object |
newInstance(java.lang.String classId,
java.lang.Class<?> superclass,
java.lang.Object... args) |
static java.lang.Class<?> |
resolveClass(java.lang.String nameOrAlias)
Try to find the class associated with a specified name or alias.
|
static void |
setClassFilter(ClassAliases.ClassFilter filter) |
public static void setClassFilter(ClassAliases.ClassFilter filter)
public static ClassAliases.ClassFilter getClassFilter()
public static boolean isClassValid(java.lang.Class<?> cls)
public static <C> boolean isClassValid(java.lang.Object comp)
public static void addPackageAliases(java.lang.String pkgName, java.lang.String regex, java.lang.Class<?> T)
public static boolean addAlias(java.lang.String alias, java.lang.Class<?> cls)
public static boolean addAlias(java.lang.String alias, java.lang.String className)
public static java.lang.String getAlias(java.lang.Class<?> cls)
public static java.lang.String getAliasOrName(java.lang.Class<?> cls)
public static java.lang.Class<?> resolveClass(java.lang.String nameOrAlias)
nameOrAlias
- string used to identity classpublic static java.lang.Object newInstance(java.lang.String classId, java.lang.Class<?> superclass) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static java.lang.Object newInstance(java.lang.String classId, java.lang.Class<?> superclass, java.lang.Object... args) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static java.lang.Object newInstance(java.lang.String classId, java.lang.Class<?> superclass, java.lang.Class<?>[] argTypes, java.lang.Object[] args) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static void main(java.lang.String[] args)