- java.lang.Object
-
- com.google.gson.internal.reflect.ReflectionAccessor
-
- com.google.gson.internal.reflect.UnsafeReflectionAccessor
-
final class UnsafeReflectionAccessor extends ReflectionAccessor
An implementation ofReflectionAccessorbased onUnsafe.NOTE: This implementation is designed for Java 9. Although it should work with earlier Java releases, it is better to use
PreJava9ReflectionAccessorfor them.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.FieldoverrideFieldprivate java.lang.ObjecttheUnsafeprivate static java.lang.ClassunsafeClass
-
Constructor Summary
Constructors Constructor Description UnsafeReflectionAccessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.reflect.FieldgetOverrideField()private static java.lang.ObjectgetUnsafeInstance()voidmakeAccessible(java.lang.reflect.AccessibleObject ao)Does the same asao.setAccessible(true), but never throwsInaccessibleObjectException(package private) booleanmakeAccessibleWithUnsafe(java.lang.reflect.AccessibleObject ao)-
Methods inherited from class com.google.gson.internal.reflect.ReflectionAccessor
getInstance
-
-
-
-
Method Detail
-
makeAccessible
public void makeAccessible(java.lang.reflect.AccessibleObject ao)
Does the same asao.setAccessible(true), but never throwsInaccessibleObjectException- Specified by:
makeAccessiblein classReflectionAccessor
-
makeAccessibleWithUnsafe
boolean makeAccessibleWithUnsafe(java.lang.reflect.AccessibleObject ao)
-
getUnsafeInstance
private static java.lang.Object getUnsafeInstance()
-
getOverrideField
private static java.lang.reflect.Field getOverrideField()
-
-