public final class ResolveHelpers
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
static java.lang.ClassLoader |
getClassLoader(java.lang.ClassLoader loader) |
Gets the
ClassLoader that's actually to be used (e.g. |
static java.lang.String |
getPackageName(java.lang.String className) |
Gets the package name of the given class name.
|
static java.lang.String |
getQualifiedFileName(java.lang.String fileName,
java.lang.String packageName) |
Qualifies the given
fileName with the given
packageName and returns the resulting file path.If packageName is null or a zero-length
String, this method will return fileName . |
static java.lang.Class |
loadClass(java.lang.ClassLoader classLoader,
java.lang.String className) |
Capsulates the ClassLoader.loadClass method to throw no exceptions but return null
instead.
|
static boolean |
namespaceEquals(java.lang.String ns1,
java.lang.String ns2) |
Compares the two strings for equality.
|
public static java.lang.String getQualifiedFileName(java.lang.String fileName, java.lang.String packageName)
fileName
with the given
packageName
and returns the resulting file path.packageName
is null
or a zero-length
String, this method will return fileName
.fileName
- The file name to be qualified.packageName
- The package name to be used for qualifying.public static java.lang.String getPackageName(java.lang.String className)
className
- The class name to retrieve the package name from.className
is null
or does not contain a package.public static boolean namespaceEquals(java.lang.String ns1, java.lang.String ns2)
public static java.lang.ClassLoader getClassLoader(java.lang.ClassLoader loader)
ClassLoader
that's actually to be used (e.g. for
loading resources).ClassLoader
is determined in the following way:
null
, it
is used.
null
,
it is used.
loader
- The "preferred" ClassLoader
.public static java.lang.Class loadClass(java.lang.ClassLoader classLoader, java.lang.String className)
classLoader
- the class loader to useclassName
- the class to loadIntalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com