org.logicalcobwebs.cglib.core
Class ReflectUtils

java.lang.Object
  extended by org.logicalcobwebs.cglib.core.ReflectUtils

public class ReflectUtils
extends java.lang.Object

Version:
$Id: ReflectUtils.java,v 1.1 2003/12/12 19:28:11 billhorsman Exp $

Field Summary
private static java.lang.String[] CGLIB_PACKAGES
           
private static java.lang.ClassLoader defaultLoader
           
private static java.lang.RuntimePermission DEFINE_CGLIB_CLASS_IN_JAVA_PACKAGE_PERMISSION
           
private static java.lang.reflect.Method DEFINE_CLASS
           
private static java.util.Map primitives
           
private static java.util.Map transforms
           
 
Constructor Summary
private ReflectUtils()
           
 
Method Summary
static java.util.List addAllMethods(java.lang.Class type, java.util.List list)
           
static java.lang.Class defineClass(java.lang.String className, byte[] b, java.lang.ClassLoader loader)
           
static java.lang.reflect.Constructor findConstructor(java.lang.String desc)
           
static java.lang.reflect.Constructor findConstructor(java.lang.String desc, java.lang.ClassLoader loader)
           
static java.lang.reflect.Method findDeclaredMethod(java.lang.Class type, java.lang.String methodName, java.lang.Class[] parameterTypes)
           
static java.lang.reflect.Method findInterfaceMethod(java.lang.Class iface)
           
static java.lang.reflect.Method findMethod(java.lang.String desc)
           
static java.lang.reflect.Method findMethod(java.lang.String desc, java.lang.ClassLoader loader)
           
static java.lang.reflect.Method findNewInstance(java.lang.Class iface)
           
static int findPackageProtected(java.lang.Class[] classes)
           
static java.beans.PropertyDescriptor[] getBeanGetters(java.lang.Class type)
           
static java.beans.PropertyDescriptor[] getBeanProperties(java.lang.Class type)
           
static java.beans.PropertyDescriptor[] getBeanSetters(java.lang.Class type)
           
private static java.lang.Class getClass(java.lang.String className, java.lang.ClassLoader loader)
           
private static java.lang.Class getClass(java.lang.String className, java.lang.ClassLoader loader, java.lang.String[] packages)
           
static java.lang.Class[] getClasses(java.lang.Object[] objects)
           
static java.lang.reflect.Constructor getConstructor(java.lang.Class type, java.lang.Class[] parameterTypes)
           
static Type[] getExceptionTypes(java.lang.reflect.Member member)
           
private static java.beans.PropertyDescriptor[] getPropertiesHelper(java.lang.Class type, boolean read, boolean write)
           
static java.lang.reflect.Method[] getPropertyMethods(java.beans.PropertyDescriptor[] properties, boolean read, boolean write)
           
static Signature getSignature(java.lang.reflect.Member member)
           
static java.lang.Object newInstance(java.lang.Class type)
           
static java.lang.Object newInstance(java.lang.Class type, java.lang.Class[] parameterTypes, java.lang.Object[] args)
           
static java.lang.Object newInstance(java.lang.reflect.Constructor cstruct, java.lang.Object[] args)
           
private static java.lang.Class[] parseTypes(java.lang.String desc, java.lang.ClassLoader loader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

primitives

private static final java.util.Map primitives

transforms

private static final java.util.Map transforms

defaultLoader

private static final java.lang.ClassLoader defaultLoader

DEFINE_CGLIB_CLASS_IN_JAVA_PACKAGE_PERMISSION

private static final java.lang.RuntimePermission DEFINE_CGLIB_CLASS_IN_JAVA_PACKAGE_PERMISSION

DEFINE_CLASS

private static final java.lang.reflect.Method DEFINE_CLASS

CGLIB_PACKAGES

private static final java.lang.String[] CGLIB_PACKAGES
Constructor Detail

ReflectUtils

private ReflectUtils()
Method Detail

getExceptionTypes

public static Type[] getExceptionTypes(java.lang.reflect.Member member)

getSignature

public static Signature getSignature(java.lang.reflect.Member member)

findConstructor

public static java.lang.reflect.Constructor findConstructor(java.lang.String desc)

findConstructor

public static java.lang.reflect.Constructor findConstructor(java.lang.String desc,
                                                            java.lang.ClassLoader loader)

findMethod

public static java.lang.reflect.Method findMethod(java.lang.String desc)

findMethod

public static java.lang.reflect.Method findMethod(java.lang.String desc,
                                                  java.lang.ClassLoader loader)

parseTypes

private static java.lang.Class[] parseTypes(java.lang.String desc,
                                            java.lang.ClassLoader loader)
                                     throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getClass

private static java.lang.Class getClass(java.lang.String className,
                                        java.lang.ClassLoader loader)
                                 throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getClass

private static java.lang.Class getClass(java.lang.String className,
                                        java.lang.ClassLoader loader,
                                        java.lang.String[] packages)
                                 throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

newInstance

public static java.lang.Object newInstance(java.lang.Class type)

newInstance

public static java.lang.Object newInstance(java.lang.Class type,
                                           java.lang.Class[] parameterTypes,
                                           java.lang.Object[] args)

newInstance

public static java.lang.Object newInstance(java.lang.reflect.Constructor cstruct,
                                           java.lang.Object[] args)

getConstructor

public static java.lang.reflect.Constructor getConstructor(java.lang.Class type,
                                                           java.lang.Class[] parameterTypes)

getClasses

public static java.lang.Class[] getClasses(java.lang.Object[] objects)

findNewInstance

public static java.lang.reflect.Method findNewInstance(java.lang.Class iface)

getPropertyMethods

public static java.lang.reflect.Method[] getPropertyMethods(java.beans.PropertyDescriptor[] properties,
                                                            boolean read,
                                                            boolean write)

getBeanProperties

public static java.beans.PropertyDescriptor[] getBeanProperties(java.lang.Class type)

getBeanGetters

public static java.beans.PropertyDescriptor[] getBeanGetters(java.lang.Class type)

getBeanSetters

public static java.beans.PropertyDescriptor[] getBeanSetters(java.lang.Class type)

getPropertiesHelper

private static java.beans.PropertyDescriptor[] getPropertiesHelper(java.lang.Class type,
                                                                   boolean read,
                                                                   boolean write)

findDeclaredMethod

public static java.lang.reflect.Method findDeclaredMethod(java.lang.Class type,
                                                          java.lang.String methodName,
                                                          java.lang.Class[] parameterTypes)
                                                   throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

addAllMethods

public static java.util.List addAllMethods(java.lang.Class type,
                                           java.util.List list)

findInterfaceMethod

public static java.lang.reflect.Method findInterfaceMethod(java.lang.Class iface)

defineClass

public static java.lang.Class defineClass(java.lang.String className,
                                          byte[] b,
                                          java.lang.ClassLoader loader)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

findPackageProtected

public static int findPackageProtected(java.lang.Class[] classes)