Top Description Fields Constructors Methods
org.springframework.objenesis.instantiator.sun

public Class SunReflectionFactorySerializationInstantiator<T>

extends Object
implements ObjectInstantiator<T>
Class Inheritance
All Implemented Interfaces
org.springframework.objenesis.instantiator.ObjectInstantiator
Annotations
@Instantiator:SERIALIZATION
Imports
java.io.NotSerializableException, java.lang.reflect.Constructor, org.springframework.objenesis.ObjenesisException, org.springframework.objenesis.instantiator.ObjectInstantiator, .SerializationInstantiatorHelper, org.springframework.objenesis.instantiator.annotations.Instantiator, .Typology

Instantiates an object using internal sun.reflect.ReflectionFactory - a class only available on JDK's that use Sun's 1.4 (or later) Java implementation. This instantiator will create classes in a way compatible with serialization, calling the first non-serializable superclass' no-arg constructor. This is the best way to instantiate an object without any side effects caused by the constructor - however it is not available on every platform.
Author
Leonardo Mesquita
See Also
ObjectInstantiator

Field Summary

Modifier and TypeField and Description
private final Constructor<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mungedConstructorback to summary
private final Constructor<T> mungedConstructor

Constructor Detail

SunReflectionFactorySerializationInstantiatorback to summary
public SunReflectionFactorySerializationInstantiator(Class<T> type)

Method Detail

newInstanceback to summary
public T newInstance()

Implements org.springframework.objenesis.instantiator.ObjectInstantiator.newInstance.

Doc from org.springframework.objenesis.instantiator.ObjectInstantiator.newInstance.

Returns a new instance of an object. The returned object's class is defined by the implementation.

Returns:T

A new instance of an object.