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

public Class SunReflectionFactoryInstantiator<T>

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

Instantiates an object, WITHOUT calling it's constructor, using internal sun.reflect.ReflectionFactory - a class only available on JDK's that use Sun's 1.4 (or later) Java implementation. 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
Joe Walnes
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
private static Constructor<Object>
public T
newInstance()

Implements org.objenesis.instantiator.ObjectInstantiator.newInstance.

Returns a new instance of an object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mungedConstructorback to summary
private final Constructor<T> mungedConstructor

Constructor Detail

SunReflectionFactoryInstantiatorback to summary
public SunReflectionFactoryInstantiator(Class<T> type)

Method Detail

getJavaLangObjectConstructorback to summary
private static Constructor<Object> getJavaLangObjectConstructor()
newInstanceback to summary
public T newInstance()

Implements org.objenesis.instantiator.ObjectInstantiator.newInstance.

Doc from org.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.