java.lang.Object
com.google.gson.internal.reflect.ReflectionHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
constructorToString
(Constructor<?> constructor) Creates a string representation for a constructor.static RuntimeException
static void
makeAccessible
(Field field) Tries making the field accessible, wrapping any thrown exception in aJsonIOException
with descriptive message.static String
tryMakeAccessible
(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 aJsonIOException
with 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;
null
if successful, non-null
if unsuccessful
-
createExceptionForUnexpectedIllegalAccess
public static RuntimeException createExceptionForUnexpectedIllegalAccess(IllegalAccessException exception)
-