java.lang.Object
org.bzdev.lang.ClassFinder
Class for determining information about a class given its name.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
classExists
(String name) Determine if a class can be found using the system class loader.static String
getBinaryName
(String name) Get the binary name of a class given its canonical name.
-
Method Details
-
classExists
Determine if a class can be found using the system class loader.The class name must be a fully qualified binary name - a period separates package components and the class name from a preceding package name, and a dollar sign separates a inner classes from outer classes.
One use case for this method is an Output Stream Graphics provider that checks if a particular class library is present.
- Parameters:
name
- the binary class name of a class- Returns:
- true if the class can be found using the system class loader; false otherwise
-
getBinaryName
Get the binary name of a class given its canonical name.- Parameters:
name
- the canonical name- Returns:
- the binary name; null if the class cannot be found
-