1 /* 2 * Copyright (C) 2021 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.hilt.internal.aggregatedroot; 18 19 import java.lang.annotation.ElementType; 20 import java.lang.annotation.Retention; 21 import java.lang.annotation.RetentionPolicy; 22 import java.lang.annotation.Target; 23 24 /** 25 * An annotation used to aggregate {@link dagger.hilt.android.HiltAndroidApp} and {@link 26 * dagger.hilt.android.testing.HiltAndroidTest} roots. 27 */ 28 @Target(ElementType.TYPE) 29 @Retention(RetentionPolicy.CLASS) 30 public @interface AggregatedRoot { 31 /** Canonical name of the root class. Only used if the below package/simple names aren't set. */ root()32 String root(); 33 34 /** 35 * Package of the root class, separated because this isn't guaranteed to be distinguishable from 36 * the canonical name. 37 */ rootPackage()38 String rootPackage(); 39 40 /** 41 * The root class's simple names, in order of outer to inner. 42 */ rootSimpleNames()43 String[] rootSimpleNames(); 44 45 /** 46 * Deprecated. Canonical name of the originating root class. Only used if the below package/simple 47 * names aren't set. 48 */ originatingRoot()49 String originatingRoot(); 50 51 /** 52 * Package of the originating root class, separated because this isn't guaranteed to be 53 * distinguishable from the canonical name. 54 */ originatingRootPackage()55 String originatingRootPackage(); 56 57 /** 58 * The originating root class's simple names, in order of outer to inner. 59 */ originatingRootSimpleNames()60 String[] originatingRootSimpleNames(); 61 rootAnnotation()62 Class<?> rootAnnotation(); 63 } 64