Package org.zkoss.lang
Class ImportedClassResolver
java.lang.Object
org.zkoss.lang.ImportedClassResolver
- All Implemented Interfaces:
Serializable,ClassResolver
The class resolve that allows to import classes and packages, like Java's
import statement does.
For example,
ImportedClassResolver resolver = new ImportedClassResolver();
resolver.addImportedClass("org.zkoss.lang.*");
resolver.addImportedClass("org.zkoss.util.Maps");
resolver.resolveClass("ImportedClassResolver");- Since:
- 6.0.0
- Author:
- tomyeh
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(ImportedClassResolver resolver) Adds all imported classes of the given class resolver.voidaddImportedClass(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.Returns a readonly list of the imported class.Class<?>resolveClass(String clsnm) Resolves the class of the specified name.
-
Constructor Details
-
ImportedClassResolver
public ImportedClassResolver()
-
-
Method Details
-
addImportedClass
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.- Parameters:
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.*.- Throws:
ClassNotFoundException
-
getImportedClasses
Returns a readonly list of the imported class. -
addAll
Adds all imported classes of the given class resolver. -
resolveClass
Description copied from interface:ClassResolverResolves the class of the specified name.- Specified by:
resolveClassin interfaceClassResolver- Throws:
ClassNotFoundException- if the class is not found.
-