public class ClassMockUtils extends Object
| Constructor and Description |
|---|
ClassMockUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
get(Object bean,
String property)
Access the value in the property of the bean.
|
static Object |
invoke(Object instance,
String method,
Class<?>[] paramTypes,
Object... parameters)
Execute a method by reflection.
|
static Object |
invoke(Object instance,
String method,
Object... parameters)
Execute a method by reflection.
|
static Object |
newInstance(IClassWriter classMock)
Creates a new instance from class generated by IClassWriter
|
static void |
set(Object bean,
String property,
Object value)
Define a value for a property inside a bean.
|
public static Object get(Object bean, String property)
bean - to inspectproperty - the name of the property to be accesspublic static void set(Object bean, String property, Object value)
bean - to inspectproperty - the name of the property to be accessvalue - to be setpublic static Object invoke(Object instance, String method, Object... parameters) throws Throwable
instance - to inspectmethod - the name of the method to be invokedparameters - the instances used to fill the parametersThrowable - in case anything goes wrongpublic static Object newInstance(IClassWriter classMock)
classMock - the class definitionpublic static Object invoke(Object instance, String method, Class<?>[] paramTypes, Object... parameters)
instance - to inspectmethod - the name of the method to be invokedparamTypes - the class types used as parameterparameters - the instances used to fill the parametersCopyright © 2018 Esfinge Framework. All rights reserved.