public final class SourceSnippets
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static InjectorMethod |
asMethod(boolean isNative,
java.lang.String signature,
java.lang.String pkg,
SourceSnippet body)
Creates an
InjectorMethod using the given SourceSnippet as
its body. |
static SourceSnippet |
callChildGetter(GinjectorBindings childBindings,
Key<?> key)
Creates a snippet that evaluates to an injected instance of the given key,
as produced by the given child.
|
static SourceSnippet |
callGetter(Key<?> key)
Creates a snippet that evaluates to an injected instance of the given key
in the current
GinjectorBindings. |
static SourceSnippet |
callGinjectorInterfaceGetter()
Creates a snippet that evaluates to the implementation of the current
Ginjector interface.
|
static SourceSnippet |
callMemberInject(TypeLiteral<?> type,
java.lang.String input)
Creates a snippet (including a trailing semicolon) that performs member
injection on a value of the given type.
|
static SourceSnippet |
callMethod(java.lang.String methodName,
java.lang.String fragmentPackageName,
java.lang.Iterable<java.lang.String> parameters)
Creates a snippet that evaluates to an invocation of the named method on
the given package fragment.
|
static SourceSnippet |
callParentGetter(Key<?> key,
GinjectorBindings parentBindings)
Creates a snippet that evaluates to an injected instance of the given key,
as produced by the given parent injector.
|
static SourceSnippet |
forText(java.lang.String text)
Creates a snippet that generates a constant text string.
|
public static SourceSnippet callChildGetter(GinjectorBindings childBindings, Key<?> key)
public static SourceSnippet callGetter(Key<?> key)
GinjectorBindings.public static SourceSnippet callMemberInject(TypeLiteral<?> type, java.lang.String input)
type - the type of value to perform member injection oninput - a Java expression that evaluates to the object that should be
member-injectedpublic static SourceSnippet callMethod(java.lang.String methodName, java.lang.String fragmentPackageName, java.lang.Iterable<java.lang.String> parameters)
Used when generating an intermediate invoker method; see
MethodCallUtil.createMethodCallWithInjection(com.google.gwt.inject.rebind.reflect.MethodLiteral<?, ?>, java.lang.String, com.google.gwt.inject.rebind.util.NameGenerator, java.util.List<com.google.gwt.inject.rebind.util.InjectorMethod>).
public static SourceSnippet callParentGetter(Key<?> key, GinjectorBindings parentBindings)
public static SourceSnippet callGinjectorInterfaceGetter()
public static SourceSnippet forText(java.lang.String text)
public static InjectorMethod asMethod(boolean isNative, java.lang.String signature, java.lang.String pkg, SourceSnippet body)
InjectorMethod using the given SourceSnippet as
its body.isNative - whether the returned method is a native methodsignature - the signature of the returned methodpkg - the package in which the returned method should be createdbody - the body text of the new method