Package io.github.libxposed.api
Interface XposedInterface.CtorInvoker<T>
- Type Parameters:
T- The type of the constructor
- All Superinterfaces:
XposedInterface.Invoker<XposedInterface.CtorInvoker<T>,Constructor<T>>
- Enclosing interface:
XposedInterface
public static interface XposedInterface.CtorInvoker<T>
extends XposedInterface.Invoker<XposedInterface.CtorInvoker<T>,Constructor<T>>
Invoker for a constructor.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.libxposed.api.XposedInterface.Invoker
XposedInterface.Invoker.Type -
Method Summary
Modifier and TypeMethodDescriptionnewInstance(Object... args) Creates a new instance through the hook chain determined by the invoker's type.<U> UnewInstanceSpecial(Class<U> subClass, Object... args) Creates a new instance of the given subclass, but initializes it with a parent constructor.Methods inherited from interface io.github.libxposed.api.XposedInterface.Invoker
invoke, invokeSpecial, setType
-
Method Details
-
newInstance
@NonNull T newInstance(Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException Creates a new instance through the hook chain determined by the invoker's type.- Parameters:
args- The arguments used for the construction- Returns:
- The instance created and initialized by the constructor
- Throws:
InvocationTargetExceptionIllegalArgumentExceptionIllegalAccessExceptionInstantiationException- See Also:
-
newInstanceSpecial
@NonNull <U> U newInstanceSpecial(@NonNull Class<U> subClass, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException Creates a new instance of the given subclass, but initializes it with a parent constructor. This could leave the object in an invalid state, where the subclass constructor is not called and the fields of the subclass are not initialized.This method is useful when you need to initialize some fields in the subclass by yourself.
- Type Parameters:
U- The type of the subclass- Parameters:
subClass- The subclass to create a new instanceargs- The arguments used for the construction- Returns:
- The instance of subclass initialized by the constructor
- Throws:
InvocationTargetExceptionIllegalArgumentExceptionIllegalAccessExceptionInstantiationException- See Also:
-