java.lang.Object
com.google.gson.internal.reflect.ReflectionHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringconstructorToString(Constructor<?> constructor) Creates a string representation for a constructor.static RuntimeExceptionstatic voidmakeAccessible(Field field) Tries making the field accessible, wrapping any thrown exception in aJsonIOExceptionwith descriptive message.static StringtryMakeAccessible(Constructor<?> constructor) Tries making the constructor accessible, returning an exception message if this fails.
-
Constructor Details
-
ReflectionHelper
private ReflectionHelper()
-
-
Method Details
-
makeAccessible
Tries making the field accessible, wrapping any thrown exception in aJsonIOExceptionwith descriptive message.- Parameters:
field- field to make accessible- Throws:
JsonIOException- if making the field accessible fails
-
constructorToString
Creates a string representation for a constructor. E.g.:java.lang.String#String(char[], int, int) -
tryMakeAccessible
Tries making the constructor accessible, returning an exception message if this fails.- Parameters:
constructor- constructor to make accessible- Returns:
- exception message;
nullif successful, non-nullif unsuccessful
-
createExceptionForUnexpectedIllegalAccess
public static RuntimeException createExceptionForUnexpectedIllegalAccess(IllegalAccessException exception)
-