org.clazzes.remoting.helper
Class ClassHelper

java.lang.Object
  extended by org.clazzes.remoting.helper.ClassHelper

public abstract class ClassHelper
extends java.lang.Object

Author:
wglas

Constructor Summary
ClassHelper()
           
 
Method Summary
static java.lang.String getArrayComponentClass(java.lang.String className)
           
static byte[] getCompiledClass(java.lang.String className, java.lang.ClassLoader cl)
          Return the compiled class from a class loader.
static boolean isArrayClass(java.lang.String className)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassHelper

public ClassHelper()
Method Detail

isArrayClass

public static boolean isArrayClass(java.lang.String className)
Parameters:
className -
Returns:
Whether the given class is an array class, i.e. the name starts with any number of open brackets followed by 'L' and ends with ';'.

getArrayComponentClass

public static java.lang.String getArrayComponentClass(java.lang.String className)
Parameters:
className - The name of a class, which may be an array.
Returns:
The class name of the array component. If the class is no array, return className.

getCompiledClass

public static byte[] getCompiledClass(java.lang.String className,
                                      java.lang.ClassLoader cl)
                               throws java.io.IOException,
                                      java.lang.ClassNotFoundException
Return the compiled class from a class loader.

Parameters:
className - The name of the class. If this is the name of an array class, the compiled class of the array component will be returned.
cl - The class loader to resolve the class resource. If null, the system class loader will be used.
Returns:
The content of the class-file for the given class.
Throws:
java.io.IOException - Upon read errors.
java.lang.ClassNotFoundException - When the .class resource could not be found.


Copyright © 2010. All Rights Reserved.