public interface ClassEnquirer
ClassLoader
.Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String name)
Checks if the name is likely available in Java.
|
java.lang.String[] |
getClassNames(java.lang.String pkgName)
Given a Java package name, gets the fully-qualified classnames available
for import in the package.
|
boolean |
supportsPackageImport()
Whether or not this ClassEnquirer supports importing Java classes at the
package level in addition to the class level.
|
boolean contains(java.lang.String name)
name
- the name to check, such as java, java.util,
java.util.ArrayListboolean supportsPackageImport()
from java.util import ArrayList
o = ArrayList()
However, only in some scenarios can the package be imported separately
without the fully qualified name, such as:
import java.util as ju
dir(ju)
o = ju.ArrayList()
This also roughly corresponds to whether or not
dir(javaPackage)
will return a list of available classes or
only the classes that have been explicitly imported.java.lang.String[] getClassNames(java.lang.String pkgName)
supportsPackageImport()
returns false.pkgName
- the name of a package the ClassEnquirer supports, such as
java.util