public class StandardTypeLocator extends java.lang.Object implements TypeLocator
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
knownPackagePrefixes |
private java.lang.ClassLoader |
loader |
Constructor and Description |
---|
StandardTypeLocator() |
StandardTypeLocator(java.lang.ClassLoader loader) |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
findType(java.lang.String typename)
Find a (possibly unqualified) type reference - first using the typename as is, then trying any registered
prefixes if the typename cannot be found.
|
java.util.List<java.lang.String> |
getImportPrefixes()
Return a list of all the import prefixes registered with this StandardTypeLocator.
|
void |
registerImport(java.lang.String prefix)
Register a new import prefix that will be used when searching for unqualified types.
|
void |
removeImport(java.lang.String prefix) |
private java.lang.ClassLoader loader
private final java.util.List<java.lang.String> knownPackagePrefixes
public StandardTypeLocator()
public StandardTypeLocator(java.lang.ClassLoader loader)
public java.lang.Class<?> findType(java.lang.String typename) throws EvaluationException
findType
in interface TypeLocator
typename
- the type to locateEvaluationException
- if the type cannot be foundpublic void registerImport(java.lang.String prefix)
prefix
- the prefix to registerpublic java.util.List<java.lang.String> getImportPrefixes()
public void removeImport(java.lang.String prefix)