|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sdm.quasar.client.core.common.util.ClassUtilities
Provides various utility methods concerning files and the class path.
| Nested Class Summary | |
static interface |
ClassUtilities.ClassUtilitiesImplementation
This is the interface that implementors must implement. |
| Method Summary | |
static boolean |
fileExistsInClassPath(java.lang.String filename)
Tests, whether a file is accessible in the class path using the ClassLoader.getResourceAsStream(java.lang.String) method of the current thread class loader. |
static java.lang.Class |
getClassForName(java.lang.String classname)
Creates a Class for the class name specified. |
static java.io.InputStream |
getResourceAsStream(java.lang.String resourcename)
Returns the resource with the given name as InputStream. |
static boolean |
isClassAssignableFrom(java.lang.Class superClassCandidate,
java.lang.Class subClassCandidate)
Checks, if the given superClassCandidate class is the same or
a superclass or superinterface of the subClassCandidate class.
|
static java.lang.Object |
newInstance(java.lang.Class cls)
Creates a new instance for the class given. |
static void |
setClassUtilitiesImplementation(ClassUtilities.ClassUtilitiesImplementation classUtilitiesImplementation)
Sets the ClassUtilities.ClassUtilitiesImplementation to be used by the ClassUtilities. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void setClassUtilitiesImplementation(ClassUtilities.ClassUtilitiesImplementation classUtilitiesImplementation)
ClassUtilities.ClassUtilitiesImplementation to be used by the ClassUtilities.
classUtilitiesImplementation - public static boolean fileExistsInClassPath(java.lang.String filename)
ClassLoader.getResourceAsStream(java.lang.String) method of the current thread class loader.
filename - the filename
public static java.lang.Class getClassForName(java.lang.String classname)
Class for the class name specified.
classname - the full qualified class name (not null)
Class object for the class name given
java.lang.IllegalArgumentException - if the class with that name could not be found
or if the class name is nullpublic static java.lang.Object newInstance(java.lang.Class cls)
Class.newInstance().
cls - the class to create an instance of (not null)
cls
java.lang.IllegalArgumentException - if no instance could be created of the
given class or if the given class is null
public static boolean isClassAssignableFrom(java.lang.Class superClassCandidate,
java.lang.Class subClassCandidate)
superClassCandidate class is the same or
a superclass or superinterface of the subClassCandidate class.
This method should work according to Class.isAssignableFrom(Class)
superClassCandidate - the super class or interface candidate to check (not null)subClassCandidate - the sub class or interface candidate to check (not null)
true if superClassCandidate is the same or
a super class or super interface of subClassCandidatepublic static java.io.InputStream getResourceAsStream(java.lang.String resourcename)
InputStream.
resourcename - the resource name
InputStream for the resource
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||