void outputStaticInjectionMethods(Class<?> type, FragmentMap fragments,
NameGenerator nameGenerator, SourceWriteUtil sourceWriteUtil) {
String methodName = nameGenerator.convertToValidMemberName("injectStatic_" + type.getName());
SourceSnippetBuilder body = new SourceSnippetBuilder();
for (InjectionPoint injectionPoint : InjectionPoint.forStaticMethodsAndFields(type)) {
Member member = injectionPoint.getMember();
try {
List<InjectorMethod> staticInjectionHelpers = new ArrayList<InjectorMethod>();
if (member instanceof Method) {
MethodLiteral<?, Method> method =
MethodLiteral.get((Method) member, TypeLiteral.get(member.getDeclaringClass()));
body.append(methodCallUtil.createMethodCallWithInjection(method, null, nameGenerator,
staticInjectionHelpers));
} else if (member instanceof Field) {
FieldLiteral<?> field =
FieldLiteral.get((Field) member, TypeLiteral.get(member.getDeclaringClass()));
body.append(sourceWriteUtil.createFieldInjection(field, null, nameGenerator,
staticInjectionHelpers));
}
outputMethods(staticInjectionHelpers, fragments);