cparsons | 4ebf6c0 | 2018-08-17 14:49:36 -0700 | [diff] [blame] | 1 | // Copyright 2018 The Bazel Authors. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | package com.google.devtools.build.lib.packages; |
| 15 | |
| 16 | import com.google.devtools.build.lib.events.Location; |
| 17 | |
| 18 | /** |
| 19 | * An instance (in the Skylark sense, not Java) of a {@link Provider}. |
| 20 | * |
| 21 | * <p>Info objects are specially handled in skylark, serving as units of information passed |
| 22 | * between targets. Each Info object must be associated with a Provider key, defined by the |
| 23 | * Provider which constructs Info objects of its type. |
| 24 | */ |
| 25 | public interface InfoInterface { |
| 26 | |
| 27 | /** |
| 28 | * Returns the Skylark location where this instance was created. |
| 29 | * |
| 30 | * <p>Builtin provider instances may return {@link Location#BUILTIN}. |
| 31 | */ |
| 32 | Location getCreationLoc(); |
| 33 | |
| 34 | /** |
| 35 | * Returns the provider instance that constructs instances of this info. |
| 36 | */ |
| 37 | Provider getProvider(); |
| 38 | } |