1 /* 2 * Copyright (C) 2017 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.functional.gwt; 18 19 import static java.lang.annotation.RetentionPolicy.RUNTIME; 20 21 import dagger.Module; 22 import dagger.Provides; 23 import java.lang.annotation.Retention; 24 import javax.inject.Inject; 25 26 interface GwtIncompatibles { 27 @Retention(RUNTIME) 28 @interface GwtIncompatible {} 29 30 @GwtIncompatible 31 class OnClass { 32 @Inject OnClass()33 OnClass() {} 34 } 35 36 class OnConstructor { 37 @Inject 38 @GwtIncompatible OnConstructor()39 OnConstructor() {} 40 } 41 42 @GwtIncompatible 43 class OuterClass { 44 static class OnOuterClass { 45 @Inject OnOuterClass()46 OnOuterClass() {} 47 } 48 } 49 50 @GwtIncompatible 51 class MembersInjectedType { 52 @Inject String string; 53 } 54 55 @GwtIncompatible 56 @Module 57 class OnModule { 58 @Provides onModule()59 static String onModule() { 60 return "on module"; 61 } 62 } 63 64 @Module 65 class OnMethod { 66 @GwtIncompatible 67 @Provides onMethod()68 static String onMethod() { 69 return "on method"; 70 } 71 } 72 } 73