langtools/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
author alanb
Fri, 10 Feb 2017 09:06:10 +0000
changeset 43767 9cff98a149cb
parent 43567 d0d89c3da7be
child 44062 9a579f258574
permissions -rw-r--r--
8173393: Module system implementation refresh (2/2017) Reviewed-by: mcimadamore, mchung, alanb Contributed-by: alan.bateman@oracle.com, mandy.chung@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
43376
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
     2
 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * accompanied this code).
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    23
 * questions.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    24
 */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    25
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    26
package javax.lang.model.element;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    27
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    28
import java.util.List;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    29
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    30
/**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    31
 * Represents a module program element.  Provides access to information
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    32
 * about the module and its members.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    33
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    34
 * @see javax.lang.model.util.Elements#getModuleOf
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    35
 * @since 9
43767
9cff98a149cb 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43567
diff changeset
    36
 * @spec JPMS
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    37
 */  // TODO: add @jls to module section
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    38
public interface ModuleElement extends Element, QualifiedNameable {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    39
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    40
    /**
43567
d0d89c3da7be 8173676: Improvements to javax.annotation.processing and javax.lang.model doc
darcy
parents: 43376
diff changeset
    41
     * Returns the fully qualified name of this module.  For an
d0d89c3da7be 8173676: Improvements to javax.annotation.processing and javax.lang.model doc
darcy
parents: 43376
diff changeset
    42
     * {@linkplain #isUnnamed() unnamed module}, an empty name is returned.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    43
     *
43567
d0d89c3da7be 8173676: Improvements to javax.annotation.processing and javax.lang.model doc
darcy
parents: 43376
diff changeset
    44
     * @return the fully qualified name of this module, or an
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    45
     * empty name if this is an unnamed module
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    46
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    47
    @Override
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    48
    Name getQualifiedName();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    49
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    50
    /**
43567
d0d89c3da7be 8173676: Improvements to javax.annotation.processing and javax.lang.model doc
darcy
parents: 43376
diff changeset
    51
     * Returns the simple name of this module.  For an {@linkplain
d0d89c3da7be 8173676: Improvements to javax.annotation.processing and javax.lang.model doc
darcy
parents: 43376
diff changeset
    52
     * #isUnnamed() unnamed module}, an empty name is returned.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    53
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    54
     * @return the simple name of this module or an empty name if
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    55
     * this is an unnamed module
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    56
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    57
    @Override
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    58
    Name getSimpleName();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    59
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    60
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    61
     * Returns the packages within this module.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    62
     * @return the packages within this module
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    63
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    64
    @Override
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    65
    List<? extends Element> getEnclosedElements();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    66
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    67
    /**
43376
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    68
     * Returns {@code true} if this is an open module and {@code
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    69
     * false} otherwise.
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    70
     *
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    71
     * @return {@code true} if this is an open module and {@code
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    72
     * false} otherwise
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    73
     */ // TODO: add @jls to unnamed module section
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    74
    boolean isOpen();
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    75
f165c71d9e03 8172810: ModuleElement should declare and provide appropriate modifiers
jjg
parents: 42407
diff changeset
    76
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    77
     * Returns {@code true} if this is an unnamed module and {@code
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    78
     * false} otherwise.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    79
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    80
     * @return {@code true} if this is an unnamed module and {@code
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    81
     * false} otherwise
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    82
     */ // TODO: add @jls to unnamed module section
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    83
    boolean isUnnamed();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    84
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    85
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    86
     * Returns {@code null} since a module is not enclosed by another
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    87
     * element.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    88
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    89
     * @return {@code null}
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    90
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    91
    @Override
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    92
    Element getEnclosingElement();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    93
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    94
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    95
     * Returns the directives contained in the declaration of this module.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    96
     * @return  the directives in the declaration of this module
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    97
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    98
    List<? extends Directive> getDirectives();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    99
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   100
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   101
     * The {@code kind} of a directive.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   102
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   103
     * <p>Note that it is possible additional directive kinds will be added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   104
     * to accommodate new, currently unknown, language structures added to
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   105
     * future versions of the Java&trade; programming language.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   106
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   107
     * @since 9
43767
9cff98a149cb 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43567
diff changeset
   108
     * @spec JPMS
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   109
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   110
    enum DirectiveKind {
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   111
        /** A "requires (static|transitive)* module-name" directive. */
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   112
        REQUIRES,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   113
        /** An "exports package-name [to module-name-list]" directive. */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   114
        EXPORTS,
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   115
        /** An "opens package-name [to module-name-list]" directive. */
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   116
        OPENS,
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   117
        /** A "uses service-name" directive. */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   118
        USES,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   119
        /** A "provides service-name with implementation-name" directive. */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   120
        PROVIDES
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   121
    };
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   122
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   123
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   124
     * Represents a "module statement" within the declaration of this module.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   125
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   126
     * @since 9
43767
9cff98a149cb 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43567
diff changeset
   127
     * @spec JPMS
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   128
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   129
     */ // TODO: add jls to Module Statement
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   130
    interface Directive {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   131
        /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   132
         * Returns the {@code kind} of this directive.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   133
         *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   134
         * @return the kind of this directive
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   135
         */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   136
        DirectiveKind getKind();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   137
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   138
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   139
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   140
     * A dependency of a module.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   141
     * @since 9
43767
9cff98a149cb 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43567
diff changeset
   142
     * @spec JPMS
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   143
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   144
    interface RequiresDirective extends Directive {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   145
        /**
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   146
         * Returns whether or not this is a static dependency.
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   147
         * @return whether or not this is a static dependency
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   148
         */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   149
        boolean isStatic();
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   150
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   151
        /**
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   152
         * Returns whether or not this is a transitive dependency.
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   153
         * @return whether or not this is a transitive dependency
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   154
         */
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   155
        boolean isTransitive();
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   156
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   157
        /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   158
         * Returns the module that is required
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   159
         * @return the module that is required
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   160
         */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   161
        ModuleElement getDependency();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   162
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   163
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   164
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   165
     * An exported package of a module.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   166
     * @since 9
43767
9cff98a149cb 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43567
diff changeset
   167
     * @spec JPMS
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   168
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   169
    interface ExportsDirective extends Directive {
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   170
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   171
        /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   172
         * Returns the package being exported.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   173
         * @return the package being exported
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   174
         */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   175
        PackageElement getPackage();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   176
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   177
        /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   178
         * Returns the specific modules to which the package is being exported,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   179
         * or null, if the package is exported to all modules which
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   180
         * have readability to this module.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   181
         * @return the specific modules to which the package is being exported
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   182
         */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   183
        List<? extends ModuleElement> getTargetModules();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   184
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   185
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   186
    /**
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   187
     * An opened package of a module.
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   188
     * @since 9
43767
9cff98a149cb 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43567
diff changeset
   189
     * @spec JPMS
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   190
     */
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   191
    interface OpensDirective extends Directive {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   192
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   193
        /**
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   194
         * Returns the package being opened.
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   195
         * @return the package being opened
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   196
         */
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   197
        PackageElement getPackage();
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   198
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   199
        /**
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   200
         * Returns the specific modules to which the package is being open
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   201
         * or null, if the package is open all modules which
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   202
         * have readability to this module.
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   203
         * @return the specific modules to which the package is being opened
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   204
         */
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   205
        List<? extends ModuleElement> getTargetModules();
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   206
    }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   207
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   208
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   209
     * An implementation of a service provided by a module.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   210
     * @since 9
43767
9cff98a149cb 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43567
diff changeset
   211
     * @spec JPMS
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   212
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   213
    interface ProvidesDirective extends Directive {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   214
        /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   215
         * Returns the service being provided.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   216
         * @return the service being provided
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   217
         */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   218
        TypeElement getService();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   219
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   220
        /**
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   221
         * Returns the implementations of the service being provided.
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   222
         * @return the implementations of the service being provided
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   223
         */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 36526
diff changeset
   224
        List<? extends TypeElement> getImplementations();
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   225
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   226
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   227
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   228
     * A reference to a service used by a module.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   229
     * @since 9
43767
9cff98a149cb 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43567
diff changeset
   230
     * @spec JPMS
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   231
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   232
    interface UsesDirective extends Directive {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   233
        /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   234
         * Returns the service that is used.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   235
         * @return the service that is used
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   236
         */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   237
        TypeElement getService();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   238
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   239
}