Remove unused framework fields
In the process, merge RequestFulfillment into BindingExpression. Without this, RequestFulfillments would need to know about BindingExpressions (to call maybeInitializeField), and BindingExpressions would need to know about their RequestFulfillment's (via requestFulfillmentDelgate). This combines both concepts and makes BindingExpression the core type.
Notably, lots of the code in BindingExpression is moved into FrameworkInstanceBindingExpression which manages the initialization of code and the interfacing with HasBindingExpressions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164980332
diff --git a/java/dagger/internal/codegen/SubcomponentBuilderBindingExpression.java b/java/dagger/internal/codegen/SubcomponentBuilderBindingExpression.java
new file mode 100644
index 0000000..0fa5195
--- /dev/null
+++ b/java/dagger/internal/codegen/SubcomponentBuilderBindingExpression.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 The Dagger Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dagger.internal.codegen;
+
+import com.squareup.javapoet.ClassName;
+import com.squareup.javapoet.CodeBlock;
+
+final class SubcomponentBuilderBindingExpression extends SimpleInvocationBindingExpression {
+ private final String subcomponentBuilderName;
+
+ SubcomponentBuilderBindingExpression(BindingExpression delegate, String subcomponentBuilderName) {
+ super(delegate);
+ this.subcomponentBuilderName = subcomponentBuilderName;
+ }
+
+ @Override
+ CodeBlock getSimpleInvocation(DependencyRequest request, ClassName requestingClass) {
+ return CodeBlock.of("new $LBuilder()", subcomponentBuilderName);
+ }
+}