Class ReflectionUtils
- java.lang.Object
-
- org.eclipse.lemminx.extensions.xerces.ReflectionUtils
-
public class ReflectionUtils extends Object
Java reflection utilities. In LemMinx context (with LemMinx binary context), Java reflection should be forbidden. But to fix some Xerces bugs and improve some Xerces feature, Java reflection is required to get access to some field which are private. It's one reason why thisReflectionUtilsis in the xerces package and not in the org.eclipse.lemminx.utils package.
-
-
Constructor Summary
Constructors Constructor Description ReflectionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TgetFieldValue(Object instance, String name)Returns the field value of the given instance and field name.static <T> voidsetFieldValue(Object instance, String name, T value)
-
-
-
Method Detail
-
getFieldValue
public static <T> T getFieldValue(Object instance, String name) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
Returns the field value of the given instance and field name.- Type Parameters:
T- the field value type.- Parameters:
instance- the instance.name- the field name.- Returns:
- the field value of the given instance and field name.
- Throws:
NoSuchFieldExceptionSecurityExceptionIllegalArgumentExceptionIllegalAccessException
-
setFieldValue
public static <T> void setFieldValue(Object instance, String name, T value) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
-
-