Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Refactoring Java generation to use the MVVM pattern (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjonesgoogle authored Aug 3, 2016
1 parent 116ed6c commit 653b6f2
Show file tree
Hide file tree
Showing 70 changed files with 3,954 additions and 2,179 deletions.
43 changes: 0 additions & 43 deletions src/main/java/com/google/api/codegen/InterfaceListView.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package com.google.api.codegen.gapic;

import com.google.api.codegen.ApiConfig;
import com.google.api.codegen.InterfaceListView;
import com.google.api.codegen.InterfaceView;
import com.google.api.codegen.ProtoFileView;
import com.google.api.codegen.SnippetSetRunner;
Expand All @@ -26,9 +25,6 @@
import com.google.api.codegen.csharp.CSharpSnippetSetRunner;
import com.google.api.codegen.go.GoGapicContext;
import com.google.api.codegen.go.GoSnippetSetRunner;
import com.google.api.codegen.java.JavaGapicContext;
import com.google.api.codegen.java.JavaIterableSnippetSetRunner;
import com.google.api.codegen.java.JavaSnippetSetRunner;
import com.google.api.codegen.nodejs.NodeJSGapicContext;
import com.google.api.codegen.nodejs.NodeJSSnippetSetRunner;
import com.google.api.codegen.py.PythonGapicContext;
Expand All @@ -38,8 +34,10 @@
import com.google.api.codegen.rendering.CommonSnippetSetRunner;
import com.google.api.codegen.ruby.RubyGapicContext;
import com.google.api.codegen.ruby.RubySnippetSetRunner;
import com.google.api.codegen.transformer.java.JavaGapicSurfaceTransformer;
import com.google.api.codegen.transformer.php.PhpGapicSurfaceTransformer;
import com.google.api.codegen.util.CommonRenderingUtil;
import com.google.api.codegen.util.java.JavaRenderingUtil;
import com.google.api.tools.framework.model.Interface;
import com.google.api.tools.framework.model.Model;
import com.google.api.tools.framework.model.ProtoFile;
Expand Down Expand Up @@ -116,28 +114,14 @@ public static List<GapicProvider<? extends Object>> defaultCreate(
.setShouldAppendPackage(true)
.build();
GapicProvider<? extends Object> mainProvider =
CommonGapicProvider.<Interface>newBuilder()
.setModel(model)
.setView(new InterfaceView())
.setContext(new JavaGapicContext(model, apiConfig))
.setSnippetSetRunner(
new JavaSnippetSetRunner<Interface>(SnippetSetRunner.SNIPPET_RESOURCE_ROOT))
.setSnippetFileNames(Arrays.asList("java/main.snip", "java/settings.snip"))
.setCodePathMapper(javaPathMapper)
.build();
GapicProvider<? extends Object> packageInfoProvider =
CommonGapicProvider.<Iterable<Interface>>newBuilder()
ViewModelGapicProvider.newBuilder()
.setModel(model)
.setView(new InterfaceListView())
.setContext(new JavaGapicContext(model, apiConfig))
.setSnippetSetRunner(
new JavaIterableSnippetSetRunner<Interface>(
SnippetSetRunner.SNIPPET_RESOURCE_ROOT))
.setSnippetFileNames(Arrays.asList("java/package-info.snip"))
.setCodePathMapper(javaPathMapper)
.setApiConfig(apiConfig)
.setSnippetSetRunner(new CommonSnippetSetRunner(new JavaRenderingUtil()))
.setModelToViewTransformer(new JavaGapicSurfaceTransformer(javaPathMapper))
.build();

return Arrays.<GapicProvider<? extends Object>>asList(mainProvider, packageInfoProvider);
return Arrays.<GapicProvider<? extends Object>>asList(mainProvider);

} else if (id.equals(NODEJS)) {
GapicCodePathMapper nodeJSPathMapper =
Expand Down
85 changes: 0 additions & 85 deletions src/main/java/com/google/api/codegen/java/JavaDocConfig.java

This file was deleted.

Loading

0 comments on commit 653b6f2

Please sign in to comment.