1 /* 2 * Copyright (C) 2019 The Dagger Authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package dagger.internal.codegen; 18 19 import static com.google.common.base.Preconditions.checkNotNull; 20 21 import javax.lang.model.element.TypeElement; 22 import javax.tools.Diagnostic; 23 24 /** A {@link CompilerOptions} object that delegates to another one. */ 25 class ForwardingCompilerOptions extends CompilerOptions { 26 27 private final CompilerOptions delegate; 28 ForwardingCompilerOptions(CompilerOptions delegate)29 ForwardingCompilerOptions(CompilerOptions delegate) { 30 this.delegate = checkNotNull(delegate); 31 } 32 33 @Override usesProducers()34 boolean usesProducers() { 35 return delegate.usesProducers(); 36 } 37 38 @Override fastInit()39 boolean fastInit() { 40 return delegate.fastInit(); 41 } 42 43 @Override formatGeneratedSource()44 boolean formatGeneratedSource() { 45 return delegate.formatGeneratedSource(); 46 } 47 48 @Override writeProducerNameInToken()49 boolean writeProducerNameInToken() { 50 return delegate.writeProducerNameInToken(); 51 } 52 53 @Override nullableValidationKind()54 Diagnostic.Kind nullableValidationKind() { 55 return delegate.nullableValidationKind(); 56 } 57 58 @Override privateMemberValidationKind()59 Diagnostic.Kind privateMemberValidationKind() { 60 return delegate.privateMemberValidationKind(); 61 } 62 63 @Override staticMemberValidationKind()64 Diagnostic.Kind staticMemberValidationKind() { 65 return delegate.staticMemberValidationKind(); 66 } 67 68 @Override ignorePrivateAndStaticInjectionForComponent()69 boolean ignorePrivateAndStaticInjectionForComponent() { 70 return delegate.ignorePrivateAndStaticInjectionForComponent(); 71 } 72 73 @Override scopeCycleValidationType()74 ValidationType scopeCycleValidationType() { 75 return delegate.scopeCycleValidationType(); 76 } 77 78 @Override warnIfInjectionFactoryNotGeneratedUpstream()79 boolean warnIfInjectionFactoryNotGeneratedUpstream() { 80 return delegate.warnIfInjectionFactoryNotGeneratedUpstream(); 81 } 82 83 @Override headerCompilation()84 boolean headerCompilation() { 85 return delegate.headerCompilation(); 86 } 87 88 @Override aheadOfTimeSubcomponents()89 boolean aheadOfTimeSubcomponents() { 90 return delegate.aheadOfTimeSubcomponents(); 91 } 92 93 @Override forceUseSerializedComponentImplementations()94 boolean forceUseSerializedComponentImplementations() { 95 return delegate.forceUseSerializedComponentImplementations(); 96 } 97 98 @Override emitModifiableMetadataAnnotations()99 boolean emitModifiableMetadataAnnotations() { 100 return delegate.emitModifiableMetadataAnnotations(); 101 } 102 103 @Override useGradleIncrementalProcessing()104 boolean useGradleIncrementalProcessing() { 105 return delegate.useGradleIncrementalProcessing(); 106 } 107 108 @Override fullBindingGraphValidationType(TypeElement element)109 ValidationType fullBindingGraphValidationType(TypeElement element) { 110 return delegate.fullBindingGraphValidationType(element); 111 } 112 113 @Override moduleHasDifferentScopesDiagnosticKind()114 Diagnostic.Kind moduleHasDifferentScopesDiagnosticKind() { 115 return delegate.moduleHasDifferentScopesDiagnosticKind(); 116 } 117 118 @Override explicitBindingConflictsWithInjectValidationType()119 ValidationType explicitBindingConflictsWithInjectValidationType() { 120 return delegate.explicitBindingConflictsWithInjectValidationType(); 121 } 122 } 123