org.kuali.rice.core.framework.resourceloader
Class ObjectDefinitionResolver

java.lang.Object
  extended by org.kuali.rice.core.framework.resourceloader.ObjectDefinitionResolver

public class ObjectDefinitionResolver
extends Object

Resolves object definitions into java Objects that are wrapped in a proxy whose classloader is the current context classloader.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
ObjectDefinitionResolver()
           
 
Method Summary
protected static Object[] buildConstructorParams(List<DataDefinition> constructorParameters)
           
protected static Class<?>[] buildConstructorParamTypes(List<DataDefinition> constructorParameters)
           
static Object createObject(ObjectDefinition definition, ClassLoader classLoader, boolean wrap)
           
static Object createObject(String className, ClassLoader classLoader)
           
protected static void invokeProperties(Object object, Collection<PropertyDefinition> properties)
           
protected static void invokeProperty(Object object, PropertyDefinition definition)
           
protected static Object loadObject(Class<?> objectClass, Object[] constructorParams, Class<?>[] constructorParamTypes)
           
static Object wrap(Object object)
          Wraps the given object in a proxy which switches the context classloader appropriately.
static Object wrap(Object object, ClassLoader classLoader)
          Wraps the given object in a proxy which switches the context classloader appropriately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectDefinitionResolver

public ObjectDefinitionResolver()
Method Detail

wrap

public static Object wrap(Object object)
Wraps the given object in a proxy which switches the context classloader appropriately. The classloader of this resource loader is used.


wrap

public static Object wrap(Object object,
                          ClassLoader classLoader)
Wraps the given object in a proxy which switches the context classloader appropriately. The given classloader is used as the context classloader.


createObject

public static Object createObject(String className,
                                  ClassLoader classLoader)

createObject

public static Object createObject(ObjectDefinition definition,
                                  ClassLoader classLoader,
                                  boolean wrap)

loadObject

protected static Object loadObject(Class<?> objectClass,
                                   Object[] constructorParams,
                                   Class<?>[] constructorParamTypes)
                            throws NoSuchMethodException,
                                   InstantiationException,
                                   IllegalAccessException,
                                   InvocationTargetException
Throws:
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException

buildConstructorParamTypes

protected static Class<?>[] buildConstructorParamTypes(List<DataDefinition> constructorParameters)

buildConstructorParams

protected static Object[] buildConstructorParams(List<DataDefinition> constructorParameters)

invokeProperties

protected static void invokeProperties(Object object,
                                       Collection<PropertyDefinition> properties)
                                throws InvocationTargetException,
                                       IllegalAccessException,
                                       NoSuchMethodException
Throws:
InvocationTargetException
IllegalAccessException
NoSuchMethodException

invokeProperty

protected static void invokeProperty(Object object,
                                     PropertyDefinition definition)
                              throws InvocationTargetException,
                                     IllegalAccessException,
                                     NoSuchMethodException
Throws:
InvocationTargetException
IllegalAccessException
NoSuchMethodException


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.