|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.repository.ClassUtil
public class ClassUtil
Utility methods to aid in class/resource loading.
Constructor Summary | |
---|---|
ClassUtil()
|
Method Summary | |
---|---|
static Class |
forName(String className,
Class caller)
Load the specified class. |
static String |
getPath(Package packageObj)
Get a package name and convert it to a path value, so it can be used in calls to methods like getResourceAsStream(java.lang.String, java.lang.Class) . |
static URL |
getResource(String resourceName,
Class<?> caller)
|
static InputStream |
getResourceAsStream(String resourceName,
Class caller)
Get the specified resource as a stream. |
static List<String> |
getResourceList(String regex,
Class caller)
|
static List<URL> |
getResources(String resourcePath,
Class<?> caller)
|
static Class |
resolveProxy(String[] interfaces,
Class caller)
Resolve a proxy for the specified interfaces. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassUtil()
Method Detail |
---|
public static Class forName(String className, Class caller) throws ClassNotFoundException
className
- The name of the class to load.caller
- The class of the caller.
ClassNotFoundException
- If the class cannot be found.public static Class resolveProxy(String[] interfaces, Class caller) throws ClassNotFoundException
interfaces
- The interfaces associated with the proxy.caller
- The class of the caller.
ClassNotFoundException
- If the class cannot be found.public static InputStream getResourceAsStream(String resourceName, Class caller)
resourceName
- The name of the class to load.caller
- The class of the caller.
public static URL getResource(String resourceName, Class<?> caller)
public static List<URL> getResources(String resourcePath, Class<?> caller) throws IOException
IOException
public static String getPath(Package packageObj)
getResourceAsStream(java.lang.String, java.lang.Class)
.
Adds a '/' prefix and converts all '." characters to '/'. Doesn't add a
trailing slash.
packageObj
- The package.
public static List<String> getResourceList(String regex, Class caller)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |