public class ImportedClassResolver extends java.lang.Object implements ClassResolver, java.io.Serializable
For example,
ImportedClassResolver resolver = new ImportedClassResolver();
resolver.addImportedClass("org.zkoss.lang.*");
resolver.addImportedClass("org.zkoss.util.Maps");
resolver.resolveClass("ImportedClassResolver");
SimpleClassResolver
,
Serialized FormConstructor and Description |
---|
ImportedClassResolver() |
Modifier and Type | Method and Description |
---|---|
void |
addAll(ImportedClassResolver resolver)
Adds all imported classes of the given class resolver.
|
void |
addImportedClass(java.lang.String clsptn)
Adds an imported class
Like Java, it is used to import a class or a package of classes, so
that it simplifies the use of the apply attribute, the init directive
and others.
|
java.util.List<java.lang.String> |
getImportedClasses()
Returns a readonly list of the imported class.
|
java.lang.Class<?> |
resolveClass(java.lang.String clsnm)
Resolves the class of the specified name.
|
public void addImportedClass(java.lang.String clsptn) throws java.lang.ClassNotFoundException
clsptn
- the class's fully-qualified name, e.g., com.foo.FooComposer
,
a wildcard representing all classes of the give package, e.g., com.foo.*
.java.lang.ClassNotFoundException
public java.util.List<java.lang.String> getImportedClasses()
public void addAll(ImportedClassResolver resolver)
public java.lang.Class<?> resolveClass(java.lang.String clsnm) throws java.lang.ClassNotFoundException
ClassResolver
resolveClass
in interface ClassResolver
java.lang.ClassNotFoundException
- if the class is not found.Copyright © 2005-2021 Potix Corporation. All Rights Reserved.