public class MethodCallUtil extends Object
| Constructor and Description |
|---|
MethodCallUtil() |
| Modifier and Type | Method and Description |
|---|---|
SourceSnippet |
createConstructorInjection(MethodLiteral<?,Constructor<?>> constructor,
NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput)
Creates a constructor injecting method and returns a string that invokes
the new method.
|
SourceSnippet |
createMethodCallWithInjection(MethodLiteral<?,?> method,
String invokeeName,
NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput)
Creates a method that calls the passed method, injecting its parameters
using getters, and returns a string that invokes the new method.
|
SourceSnippet |
createMethodCallWithInjection(MethodLiteral<?,?> method,
String invokeeName,
String[] parameterNames,
NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput)
Creates a method that calls the passed method, injecting its parameters
using getters as necessary, and returns a string that invokes the new
method.
|
public SourceSnippet createConstructorInjection(MethodLiteral<?,Constructor<?>> constructor, NameGenerator nameGenerator, List<InjectorMethod> methodsOutput) throws NoSourceNameException
constructor - constructor to callnameGenerator - NameGenerator to be used for ensuring method name uniquenessmethodsOutput - a list where all new methods created by this
call are addedNoSourceNameExceptionpublic SourceSnippet createMethodCallWithInjection(MethodLiteral<?,?> method, String invokeeName, NameGenerator nameGenerator, List<InjectorMethod> methodsOutput) throws NoSourceNameException
method - method to call (can be constructor)invokeeName - expression that evaluates to the object on which
the method is to be called. If null the method will be called
in the current scope.nameGenerator - NameGenerator to be used for ensuring method name uniquenessmethodsOutput - a list where all new methods created by this
call are addedNoSourceNameExceptionpublic SourceSnippet createMethodCallWithInjection(MethodLiteral<?,?> method, String invokeeName, String[] parameterNames, NameGenerator nameGenerator, List<InjectorMethod> methodsOutput) throws NoSourceNameException
CreationException.method - method to call (can be constructor)invokeeName - expression that evaluates to the object on which
the method is to be called. If null the method will be called
in the current scope.parameterNames - array with parameter names that can replace getter
methods (usually used to fetch injected values) in the returned
string. The array length must match the number of method
parameters. A null value denotes that the getter method
should be used.nameGenerator - NameGenerator to use for ensuring method name uniquenessmethodsOutput - a list where all new methods created by this
call are addedNoSourceNameExceptionCopyright © 2008–2018. All rights reserved.