< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java

Print this page




 908         public Name version;
 909         public JavaFileManager.Location sourceLocation;
 910         public JavaFileManager.Location classLocation;
 911 
 912         /** All directives, in natural order. */
 913         public List<com.sun.tools.javac.code.Directive> directives;
 914         public List<com.sun.tools.javac.code.Directive.RequiresDirective> requires;
 915         public List<com.sun.tools.javac.code.Directive.ExportsDirective> exports;
 916         public List<com.sun.tools.javac.code.Directive.OpensDirective> opens;
 917         public List<com.sun.tools.javac.code.Directive.ProvidesDirective> provides;
 918         public List<com.sun.tools.javac.code.Directive.UsesDirective> uses;
 919 
 920         public ClassSymbol module_info;
 921 
 922         public PackageSymbol unnamedPackage;
 923         public Map<Name, PackageSymbol> visiblePackages;
 924         public List<Symbol> enclosedPackages = List.nil();
 925 
 926         public Completer usesProvidesCompleter = Completer.NULL_COMPLETER;
 927         public final Set<ModuleFlags> flags = EnumSet.noneOf(ModuleFlags.class);

 928 
 929         /**
 930          * Create a ModuleSymbol with an associated module-info ClassSymbol.
 931          */
 932         public static ModuleSymbol create(Name name, Name module_info) {
 933             ModuleSymbol msym = new ModuleSymbol(name, null);
 934             ClassSymbol info = new ClassSymbol(Flags.MODULE, module_info, msym);
 935             info.fullname = formFullName(module_info, msym);
 936             info.flatname = info.fullname;
 937             info.members_field = WriteableScope.create(info);
 938             msym.module_info = info;
 939             return msym;
 940         }
 941 
 942         public ModuleSymbol(Name name, Symbol owner) {
 943             super(MDL, 0, name, null, owner);
 944             Assert.checkNonNull(name);
 945             this.type = new ModuleType(this);
 946         }
 947 


1020 
1021     }
1022 
1023     public enum ModuleFlags {
1024         OPEN(0x0020),
1025         SYNTHETIC(0x1000),
1026         MANDATED(0x8000);
1027 
1028         public static int value(Set<ModuleFlags> s) {
1029             int v = 0;
1030             for (ModuleFlags f: s)
1031                 v |= f.value;
1032             return v;
1033         }
1034 
1035         private ModuleFlags(int value) {
1036             this.value = value;
1037         }
1038 
1039         public final int value;







1040 












1041     }
1042 
1043     /** A class for package symbols
1044      */
1045     public static class PackageSymbol extends TypeSymbol
1046         implements PackageElement {
1047 
1048         public WriteableScope members_field;
1049         public Name fullname;
1050         public ClassSymbol package_info; // see bug 6443073
1051         public ModuleSymbol modle;
1052 
1053         public PackageSymbol(Name name, Type type, Symbol owner) {
1054             super(PCK, 0, name, type, owner);
1055             this.members_field = null;
1056             this.fullname = formFullName(name, owner);
1057         }
1058 
1059         public PackageSymbol(Name name, Symbol owner) {
1060             this(name, null, owner);




 908         public Name version;
 909         public JavaFileManager.Location sourceLocation;
 910         public JavaFileManager.Location classLocation;
 911 
 912         /** All directives, in natural order. */
 913         public List<com.sun.tools.javac.code.Directive> directives;
 914         public List<com.sun.tools.javac.code.Directive.RequiresDirective> requires;
 915         public List<com.sun.tools.javac.code.Directive.ExportsDirective> exports;
 916         public List<com.sun.tools.javac.code.Directive.OpensDirective> opens;
 917         public List<com.sun.tools.javac.code.Directive.ProvidesDirective> provides;
 918         public List<com.sun.tools.javac.code.Directive.UsesDirective> uses;
 919 
 920         public ClassSymbol module_info;
 921 
 922         public PackageSymbol unnamedPackage;
 923         public Map<Name, PackageSymbol> visiblePackages;
 924         public List<Symbol> enclosedPackages = List.nil();
 925 
 926         public Completer usesProvidesCompleter = Completer.NULL_COMPLETER;
 927         public final Set<ModuleFlags> flags = EnumSet.noneOf(ModuleFlags.class);
 928         public final Set<ModuleResolutionFlags> resolutionFlags = EnumSet.noneOf(ModuleResolutionFlags.class);
 929 
 930         /**
 931          * Create a ModuleSymbol with an associated module-info ClassSymbol.
 932          */
 933         public static ModuleSymbol create(Name name, Name module_info) {
 934             ModuleSymbol msym = new ModuleSymbol(name, null);
 935             ClassSymbol info = new ClassSymbol(Flags.MODULE, module_info, msym);
 936             info.fullname = formFullName(module_info, msym);
 937             info.flatname = info.fullname;
 938             info.members_field = WriteableScope.create(info);
 939             msym.module_info = info;
 940             return msym;
 941         }
 942 
 943         public ModuleSymbol(Name name, Symbol owner) {
 944             super(MDL, 0, name, null, owner);
 945             Assert.checkNonNull(name);
 946             this.type = new ModuleType(this);
 947         }
 948 


1021 
1022     }
1023 
1024     public enum ModuleFlags {
1025         OPEN(0x0020),
1026         SYNTHETIC(0x1000),
1027         MANDATED(0x8000);
1028 
1029         public static int value(Set<ModuleFlags> s) {
1030             int v = 0;
1031             for (ModuleFlags f: s)
1032                 v |= f.value;
1033             return v;
1034         }
1035 
1036         private ModuleFlags(int value) {
1037             this.value = value;
1038         }
1039 
1040         public final int value;
1041     }
1042 
1043     public enum ModuleResolutionFlags {
1044         DO_NOT_RESOLVE_BY_DEFAULT(0x0001),
1045         WARN_DEPRECATED(0x0002),
1046         WARN_DEPRECATED_REMOVAL(0x0004),
1047         WARN_INCUBATOR(0x0008);
1048 
1049         public static int value(Set<ModuleResolutionFlags> s) {
1050             int v = 0;
1051             for (ModuleResolutionFlags f: s)
1052                 v |= f.value;
1053             return v;
1054         }
1055 
1056         private ModuleResolutionFlags(int value) {
1057             this.value = value;
1058         }
1059 
1060         public final int value;
1061     }
1062 
1063     /** A class for package symbols
1064      */
1065     public static class PackageSymbol extends TypeSymbol
1066         implements PackageElement {
1067 
1068         public WriteableScope members_field;
1069         public Name fullname;
1070         public ClassSymbol package_info; // see bug 6443073
1071         public ModuleSymbol modle;
1072 
1073         public PackageSymbol(Name name, Type type, Symbol owner) {
1074             super(PCK, 0, name, type, owner);
1075             this.members_field = null;
1076             this.fullname = formFullName(name, owner);
1077         }
1078 
1079         public PackageSymbol(Name name, Symbol owner) {
1080             this(name, null, owner);


< prev index next >