Package com.liferay.portal.kernel.test
Class ReflectionTestUtil
Object
com.liferay.portal.kernel.test.ReflectionTestUtil
- Author:
- Shuyang Zhou
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetAndSetFieldValue(Class<?> clazz, String fieldName, T newValue) static <T> TgetAndSetFieldValue(Object instance, String fieldName, T newValue) static MethodgetBridgeMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) static Fieldstatic <T> TgetFieldValue(Class<?> clazz, String fieldName) static <T> TgetFieldValue(Object instance, String fieldName) static Methodstatic <T> Tstatic <T> Tstatic <T> TinvokeBridge(Object instance, String methodName, Class<?>[] parameterTypes, Object... parameters) static <T extends Enum<T>>
TnewEnumElement(Class<T> enumClass, Class<?>[] constructorParameterTypes, String name, int ordinal, Object... constructorParameters) static <T extends Enum<T>>
TnewEnumElement(Class<T> enumClass, String name, int ordinal) static voidsetFieldValue(Class<?> clazz, String fieldName, Object value) static voidsetFieldValue(Object instance, String fieldName, Object value) static voidsetFieldValue(Field field, Object instance, Object value) static AutoCloseablesetFieldValueWithAutoCloseable(Class<?> clazz, String fieldName, Object newValue) static AutoCloseablesetFieldValueWithAutoCloseable(Object instance, String fieldName, Object newValue)
-
Constructor Details
-
ReflectionTestUtil
public ReflectionTestUtil()
-
-
Method Details
-
getAndSetFieldValue
-
getAndSetFieldValue
-
getBridgeMethod
-
getField
-
getFieldValue
-
getFieldValue
-
getMethod
-
invoke
-
invoke
-
invokeBridge
-
newEnumElement
-
newEnumElement
-
setFieldValue
-
setFieldValue
-
setFieldValue
-
setFieldValueWithAutoCloseable
public static AutoCloseable setFieldValueWithAutoCloseable(Class<?> clazz, String fieldName, Object newValue) -
setFieldValueWithAutoCloseable
public static AutoCloseable setFieldValueWithAutoCloseable(Object instance, String fieldName, Object newValue)
-