Class Android17Instantiator<T>
- java.lang.Object
-
- org.objenesis.instantiator.android.Android17Instantiator<T>
-
- All Implemented Interfaces:
ObjectInstantiator<T>
@Instantiator(STANDARD) public class Android17Instantiator<T> extends java.lang.Object implements ObjectInstantiator<T>
Instantiator for Android API level 11 to 17 which creates objects without driving their constructors, using internal methods on the Dalvik implementation ofObjectStreamClass.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.MethodnewInstanceMethodprivate java.lang.IntegerobjectConstructorIdprivate java.lang.Class<T>type
-
Constructor Summary
Constructors Constructor Description Android17Instantiator(java.lang.Class<T> type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.IntegerfindConstructorIdForJavaLangObjectConstructor()private static java.lang.reflect.MethodgetNewInstanceMethod()TnewInstance()Returns a new instance of an object.
-
-
-
Field Detail
-
type
private final java.lang.Class<T> type
-
newInstanceMethod
private final java.lang.reflect.Method newInstanceMethod
-
objectConstructorId
private final java.lang.Integer objectConstructorId
-
-
Constructor Detail
-
Android17Instantiator
public Android17Instantiator(java.lang.Class<T> type)
-
-
Method Detail
-
newInstance
public T newInstance()
Description copied from interface:ObjectInstantiatorReturns a new instance of an object. The returned object's class is defined by the implementation.- Specified by:
newInstancein interfaceObjectInstantiator<T>- Returns:
- A new instance of an object.
-
getNewInstanceMethod
private static java.lang.reflect.Method getNewInstanceMethod()
-
findConstructorIdForJavaLangObjectConstructor
private static java.lang.Integer findConstructorIdForJavaLangObjectConstructor()
-
-