Top Description Fields Constructors Methods
com.thoughtworks.xstream.converters.reflection

public Class SunUnsafeReflectionProvider

extends SunLimitedUnsafeReflectionProvider
Class Inheritance
Known Direct Subclasses
com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider
Imports
java.lang.reflect.Field, java.util.Map, .WeakHashMap

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.

Authors
Joe Walnes, Brian Slesinsky, Jörg Schaible
Since
1.4.7

Field Summary

Modifier and TypeField and Description
private transient Map<K, V>
Inherited from com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider:
exceptionunsafe

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
private synchronized long
protected void
private Object
private void
write(Field field, Object object, Object value)

public void
Inherited from com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider:
newInstancevalidateFieldAccess

Field Detail

fieldOffsetCacheback to summary
private transient Map<K, V> fieldOffsetCache

Constructor Detail

SunUnsafeReflectionProviderback to summary
public SunUnsafeReflectionProvider()
Since
1.4.7
SunUnsafeReflectionProviderback to summary
public SunUnsafeReflectionProvider(FieldDictionary dic)
Since
1.4.7

Method Detail

getFieldOffsetback to summary
private synchronized long getFieldOffset(Field f)
initback to summary
protected void init()

Overrides com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.init.

readResolveback to summary
private Object readResolve()

Hides com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider.readResolve.

writeback to summary
private void write(Field field, Object object, Object value)
writeFieldback to summary
public void writeField(Object object, String fieldName, Object value, Class<T> definedIn)

Overrides com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.writeField.

Implements com.thoughtworks.xstream.converters.reflection.ReflectionProvider.writeField.