public interface Injector
| Modifier and Type | Method and Description |
|---|---|
Injector |
duplicate(InjectorController controller)
Duplicate (clone) resources
|
<T> ConstructorInjector<T> |
forConstructor(Class<T> type)
Create injector for the given type
|
org.panda_lang.utilities.inject.GeneratedMethodInjector |
forGeneratedMethod(Method method)
Generate injector for the given method
|
Injector |
fork(InjectorController controller)
Create a fork of resources.
|
MethodInjector |
forMethod(Method method)
Create injector for the given method
|
InjectorResources |
getResources()
Get resources of injector
|
<T> T |
invokeMethod(Method method,
@Nullable Object instance,
Object... injectorArgs)
Invoke the method using Injector
|
<T> T |
invokeParameter(Parameter parameter,
Object... injectorArgs)
Get injected value of the given parameter
|
<T> T |
newInstance(Class<T> type,
Object... injectorArgs)
Create a new instance of the specified type using Injector
|
<T> T newInstance(Class<T> type, Object... injectorArgs) throws Throwable
T - the typetype - the class to instantiateThrowable - if anything happen in constructor<T> ConstructorInjector<T> forConstructor(Class<T> type)
T - type of classtype - the type to process@Nullable <T> T invokeMethod(Method method, @Nullable @Nullable Object instance, Object... injectorArgs) throws Throwable
T - the return typemethod - the method to invokeinstance - the instance to use (nullable for static context)Throwable - if anything happen in the invoked methodMethodInjector forMethod(Method method)
method - the method to processorg.panda_lang.utilities.inject.GeneratedMethodInjector forGeneratedMethod(Method method) throws Exception
method - the method to process (works only for public properties)Exception - if anything happen during the generation of method wrapper@Nullable <T> T invokeParameter(Parameter parameter, Object... injectorArgs) throws Throwable
T - type of expected valueparameter - the parameter invokeInjectorException - if anything happenThrowableInjector fork(InjectorController controller)
controller - initializer for a new instance of resourcesInjector duplicate(InjectorController controller)
controller - initializer for a new instance of resourcesInjectorResources getResources()
Copyright © 2020. All rights reserved.