|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crosswire.common.util.ClassUtil
public final class ClassUtil
Various Java Class Utilities.
The GNU Lesser General Public License for details.| Field Summary | |
|---|---|
private static String |
EXTENSION_CLASS
|
private static String |
EXTENSION_JAR
|
private static String |
EXTENSION_ZIP
|
private static char |
INNER_CLASS_SEPARATOR_CHAR
The inner class separator character: $. |
private static org.slf4j.Logger |
LOGGER
The log stream |
private static char |
PACKAGE_SEPARATOR_CHAR
The package separator character: .. |
| Constructor Summary | |
|---|---|
private |
ClassUtil()
Prevent instantiation |
| Method Summary | |
|---|---|
static String |
findClasspathEntry(String className)
This function find the first matching filename for a Java class file from the classpath, if none is found it returns null. |
static String |
findClasspathEntry(String className,
String classPath)
This function finds the first matching filename for a Java class file from the classpath, if none is found it returns null. |
static Class<?> |
forName(String className)
Gets the Class for the className in a way that works well for extensions. |
static String |
getShortClassName(Class<?> cls)
Gets the class name minus the package name from a Class. |
static String |
getShortClassName(Object object,
String valueIfNull)
Gets the class name minus the package name for an Object. |
static String |
getShortClassName(String className)
Gets the class name minus the package name from a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final char PACKAGE_SEPARATOR_CHAR
..
private static final char INNER_CLASS_SEPARATOR_CHAR
$.
private static final String EXTENSION_CLASS
private static final String EXTENSION_JAR
private static final String EXTENSION_ZIP
private static final org.slf4j.Logger LOGGER
| Constructor Detail |
|---|
private ClassUtil()
| Method Detail |
|---|
public static Class<?> forName(String className)
throws ClassNotFoundException
className - the class to get
ClassNotFoundException - if the class is not found
public static String findClasspathEntry(String className,
String classPath)
className - the class to getclassPath - the lookup class path
public static String findClasspathEntry(String className)
className - the class to get
public static String getShortClassName(Object object,
String valueIfNull)
Object.
object - the class to get the short name for, may be nullvalueIfNull - the value to return if null
public static String getShortClassName(Class<?> cls)
Class.
cls - the class to get the short name for, must not be
null
IllegalArgumentException - if the class is nullpublic static String getShortClassName(String className)
The string passed in is assumed to be a class name - it is not checked.
className - the className to get the short name for, must not be empty or
null
IllegalArgumentException - if the className is empty
|
Copyright ยจ 2003-2015 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||