Class SunUnsafeReflectionProvider
java.lang.Object
com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider
com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider
com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider
- All Implemented Interfaces:
ReflectionProvider
- Direct Known Subclasses:
Sun14ReflectionProvider
Instantiates a new object bypassing the constructor using undocumented internal JDK features.
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.
- Since:
- 1.4.7
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.converters.reflection.ReflectionProvider
ReflectionProvider.Visitor
-
Field Summary
FieldsFields inherited from class com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider
exception, unsafe
Fields inherited from class com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider
fieldDictionary
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Methods inherited from class com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider
newInstance, validateFieldAccess
Methods inherited from class com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider
fieldDefinedInClass, fieldModifiersSupported, getField, getFieldOrNull, getFieldType, setFieldDictionary, visitSerializableFields
-
Field Details
-
fieldOffsetCache
-
-
Constructor Details
-
SunUnsafeReflectionProvider
public SunUnsafeReflectionProvider()- Since:
- 1.4.7
-
SunUnsafeReflectionProvider
- Since:
- 1.4.7
-
-
Method Details
-
writeField
- Specified by:
writeField
in interfaceReflectionProvider
- Overrides:
writeField
in classPureJavaReflectionProvider
-
write
-
getFieldOffset
-
readResolve
-
init
protected void init()- Overrides:
init
in classPureJavaReflectionProvider
-