类 StandardTypeLocator
java.lang.Object
cn.taketoday.core.DefaultAliasRegistry
cn.taketoday.expression.spel.support.StandardTypeLocator
- 所有已实现的接口:
AliasRegistry,TypeLocator
A simple implementation of
TypeLocator that uses the context ClassLoader
(or any ClassLoader set upon it). It supports 'well-known' packages: So if a
type cannot be found, it will try the registered imports to locate it.- 从以下版本开始:
- 4.0
- 作者:
- Andy Clement, Juergen Hoeller, Harry Yang
-
字段概要
从类继承的字段 cn.taketoday.core.DefaultAliasRegistry
log -
构造器概要
构造器构造器说明Create a StandardTypeLocator for the default ClassLoader (typically, the thread context ClassLoader).StandardTypeLocator(ClassLoader classLoader) Create a StandardTypeLocator for the given ClassLoader. -
方法概要
修饰符和类型方法说明Class<?>Resolve a class name.Class<?>getClassFor(String className) Return a list of all the import prefixes registered with this StandardTypeLocator.voidimportClass(Class<?> classToImport) Import a class.voidimportClass(String name) Import a class.voidregisterAlias(Class<?> classToImport, String... alias) voidregisterImport(String prefix) Register a new import prefix that will be used when searching for unqualified types.voidremoveImport(String prefix) Remove that specified prefix from this locator's list of imports.从类继承的方法 cn.taketoday.core.DefaultAliasRegistry
allowAliasOverriding, canonicalName, checkForAliasCircle, getAliases, getAliasList, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases
-
构造器详细资料
-
StandardTypeLocator
public StandardTypeLocator()Create a StandardTypeLocator for the default ClassLoader (typically, the thread context ClassLoader). -
StandardTypeLocator
Create a StandardTypeLocator for the given ClassLoader.- 参数:
classLoader- the ClassLoader to delegate to
-
-
方法详细资料
-
registerImport
Register a new import prefix that will be used when searching for unqualified types. Expected format is something like "java.lang".- 参数:
prefix- the prefix to register
-
removeImport
Remove that specified prefix from this locator's list of imports.- 参数:
prefix- the prefix to remove
-
getImportPrefixes
Return a list of all the import prefixes registered with this StandardTypeLocator.- 返回:
- a list of registered import prefixes
-
importClass
Import a class.- 参数:
name- The full class name of the class to be imported- 抛出:
ExpressionException- if the name does not include a ".".
-
importClass
Import a class. -
registerAlias
-
findType
Resolve a class name.- 指定者:
findType在接口中TypeLocator- 参数:
typeName- The name of the class (without package name) to be resolved.- 返回:
- If the class has been imported previously, with
importClass(java.lang.String)orregisterImport(String), then its Class instance. Otherwisenull. - 抛出:
ExpressionException- if the class is abstract or is an interface, or not public.EvaluationException- if there is a problem finding the type
-
getClassFor
-