xmlBlaster 2.1.0 API

org.xmlBlaster.util.classloader
Class ClassLoaderUtils

java.lang.Object
  extended by org.xmlBlaster.util.classloader.ClassLoaderUtils

public class ClassLoaderUtils
extends java.lang.Object

Utility methods for class loader to package names, etc.

Version:
$Revision: 1.19.4.2 $
Author:
Scott.Stark@jboss.org

Nested Class Summary
(package private) static class ClassLoaderUtils.ClassPathEntry
           
(package private) static class ClassLoaderUtils.ClassPathIterator
          An iterator for jar entries or directory structures.
(package private) static class ClassLoaderUtils.FileIterator
           
 
Constructor Summary
ClassLoaderUtils()
           
 
Method Summary
static void displayClassInfo(java.lang.Class clazz, java.lang.StringBuffer results)
          Format a string buffer containing the Class, Interfaces, CodeSource, and ClassLoader information for the given object clazz.
static java.net.URLClassLoader[] getClassLoaderStack(java.lang.ClassLoader cl)
          Get all of the URLClassLoaders from cl on up the hierarchy
static java.net.URL[] getClassLoaderURLs(java.lang.ClassLoader cl)
          Use reflection to access a URL[] getURLs or URL[] getClasspath method so that non-URLClassLoader class loaders, or class loaders that override getURLs to return null or empty, can provide the true classpath info.
static java.lang.String getJarClassName(java.lang.String className)
          Translates a dot class name (java.lang.String) into a path form suitable for a jar entry (java/lang/String.class)
static java.lang.String getResourceName(java.lang.String className)
          Parse a class name into its resource form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderUtils

public ClassLoaderUtils()
Method Detail

displayClassInfo

public static void displayClassInfo(java.lang.Class clazz,
                                    java.lang.StringBuffer results)
Format a string buffer containing the Class, Interfaces, CodeSource, and ClassLoader information for the given object clazz.

Parameters:
clazz - the Class
results - - the buffer to write the info to

getClassLoaderURLs

public static java.net.URL[] getClassLoaderURLs(java.lang.ClassLoader cl)
Use reflection to access a URL[] getURLs or URL[] getClasspath method so that non-URLClassLoader class loaders, or class loaders that override getURLs to return null or empty, can provide the true classpath info.


getClassLoaderStack

public static java.net.URLClassLoader[] getClassLoaderStack(java.lang.ClassLoader cl)
Get all of the URLClassLoaders from cl on up the hierarchy

Parameters:
cl - the class loader to start from
Returns:
The possibly empty array of URLClassLoaders from cl through its parent class loaders

getJarClassName

public static java.lang.String getJarClassName(java.lang.String className)
Translates a dot class name (java.lang.String) into a path form suitable for a jar entry (java/lang/String.class)

Parameters:
className - java.lang.String
Returns:
java/lang/String.class

getResourceName

public static java.lang.String getResourceName(java.lang.String className)
Parse a class name into its resource form. This has to handle array classes whose name is prefixed with [L.


xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.