You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.7 KiB
51 lines
1.7 KiB
/*
|
|
* Copyright (C) 2019 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.hilt;
|
|
|
|
import static java.lang.annotation.RetentionPolicy.CLASS;
|
|
|
|
import java.lang.annotation.ElementType;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.Target;
|
|
|
|
/**
|
|
* Annotation for marking an interface as an entry point into a generated component. This annotation
|
|
* must be used with {@link dagger.hilt.InstallIn} to indicate which component(s) should have this
|
|
* entry point. When assembling components, Hilt will make the indicated components extend the
|
|
* interface marked with this annotation.
|
|
*
|
|
* <p>To use the annotated interface to access Dagger objects, use {@link dagger.hilt.EntryPoints}.
|
|
*
|
|
* <p>Example usage:
|
|
*
|
|
* <pre><code>
|
|
* {@literal @}EntryPoint
|
|
* {@literal @}InstallIn(SingletonComponent.class)
|
|
* public interface FooEntryPoint {
|
|
* Foo getFoo();
|
|
* }
|
|
*
|
|
* Foo foo = EntryPoints.get(component, FooEntryPoint.class).getFoo();
|
|
* </code></pre>
|
|
*
|
|
* @see <a href="https://dagger.dev/hilt/entry-points">Entry points</a>
|
|
*/
|
|
@Retention(CLASS)
|
|
@Target(ElementType.TYPE)
|
|
@GeneratesRootInput
|
|
public @interface EntryPoint {}
|