|
15 | 15 | */ |
16 | 16 | package io.github.ascopes.jct.containers; |
17 | 17 |
|
| 18 | +import io.github.ascopes.jct.workspaces.PathRoot; |
| 19 | +import java.util.List; |
18 | 20 | import javax.tools.JavaFileManager.Location; |
19 | 21 | import org.apiguardian.api.API; |
20 | 22 | import org.apiguardian.api.API.Status; |
|
29 | 31 | * {@link #getOrCreateModule(String) create} the module, and then operate on that sub-container |
30 | 32 | * group. Operations on non-module packages should operate on this container group directly. |
31 | 33 | * |
| 34 | + * <p>Note that each container group will usually only support one package container group |
| 35 | + * in the outputs. This is due to the JSR-199 API not providing a method for specifying which |
| 36 | + * output location to write files to for legacy-style packages. |
| 37 | + * |
32 | 38 | * @author Ashley Scopes |
33 | 39 | * @since 0.0.1 |
34 | 40 | */ |
35 | 41 | @API(since = "0.0.1", status = Status.STABLE) |
36 | 42 | public interface OutputContainerGroup extends PackageContainerGroup, ModuleContainerGroup { |
37 | 43 |
|
| 44 | + /** |
| 45 | + * {@inheritDoc} |
| 46 | + * |
| 47 | + * <p>Note that this implementation will only ever allow a single container in the package |
| 48 | + * container groups. If a container is already present, then an exception will be thrown. |
| 49 | + * |
| 50 | + * @param path the path to add. |
| 51 | + * @throws IllegalStateException if a package already exists in this location. |
| 52 | + */ |
| 53 | + @Override |
| 54 | + void addPackage(PathRoot path); |
| 55 | + |
| 56 | + |
| 57 | + /** |
| 58 | + * {@inheritDoc} |
| 59 | + * |
| 60 | + * <p>Note that this implementation will only ever allow a single container in the package |
| 61 | + * container groups. If a container is already present, then an exception will be thrown. |
| 62 | + * |
| 63 | + * @param container the container to add. |
| 64 | + * @throws IllegalStateException if a package already exists in this location. |
| 65 | + */ |
| 66 | + @Override |
| 67 | + void addPackage(Container container); |
| 68 | + |
38 | 69 | /** |
39 | 70 | * Get the output-oriented location. |
40 | 71 | * |
41 | 72 | * @return the output-oriented location. |
42 | 73 | */ |
43 | 74 | @Override |
44 | 75 | Location getLocation(); |
| 76 | + |
| 77 | + /** |
| 78 | + * {@inheritDoc} |
| 79 | + * |
| 80 | + * <p>Note that this implementation will only ever return one container in the list due to |
| 81 | + * JSR-199 limitations. |
| 82 | + * |
| 83 | + * @return the list containing the package container, if it exists. Otherwise, an empty list is |
| 84 | + * returned instead. |
| 85 | + */ |
| 86 | + @Override |
| 87 | + List<Container> getPackages(); |
45 | 88 | } |
0 commit comments