public class SunUnsafeReflectionProvider extends SunLimitedUnsafeReflectionProvider
The code in the constructor will never be executed and parameters do not have to be known. This is the same method used by the internals of standard Java serialization, but relies on internal code (sun.misc.Unsafe) that may not be present on all JVMs.
The implementation will use the same internals to write into fields. This is a lot faster and was additionally the only possibility to set final fields prior to Java 5.
ReflectionProvider.Visitor
exception, unsafe
fieldDictionary
Constructor and Description |
---|
SunUnsafeReflectionProvider() |
SunUnsafeReflectionProvider(FieldDictionary dic) |
Modifier and Type | Method and Description |
---|---|
protected void |
init() |
void |
writeField(java.lang.Object object,
java.lang.String fieldName,
java.lang.Object value,
java.lang.Class definedIn) |
newInstance, validateFieldAccess
fieldDefinedInClass, fieldModifiersSupported, getField, getFieldOrNull, getFieldType, setFieldDictionary, visitSerializableFields
public SunUnsafeReflectionProvider()
public SunUnsafeReflectionProvider(FieldDictionary dic)
public void writeField(java.lang.Object object, java.lang.String fieldName, java.lang.Object value, java.lang.Class definedIn)
writeField
in interface ReflectionProvider
writeField
in class PureJavaReflectionProvider
protected void init()
init
in class PureJavaReflectionProvider
Copyright © 2004–2024 XStream. All rights reserved.