< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java

Print this page




  53     public final Name empty;
  54     public final Name hyphen;
  55     public final Name one;
  56     public final Name slash;
  57 
  58     // keywords
  59     public final Name _class;
  60     public final Name _super;
  61     public final Name _this;
  62     public final Name var;
  63     public final Name exports;
  64     public final Name opens;
  65     public final Name module;
  66     public final Name provides;
  67     public final Name requires;
  68     public final Name to;
  69     public final Name transitive;
  70     public final Name uses;
  71     public final Name open;
  72     public final Name with;


  73     public final Name yield;
  74 
  75     // field and method names
  76     public final Name _name;
  77     public final Name addSuppressed;
  78     public final Name any;
  79     public final Name append;
  80     public final Name clinit;
  81     public final Name clone;
  82     public final Name close;
  83     public final Name deserializeLambda;
  84     public final Name desiredAssertionStatus;
  85     public final Name equals;

  86     public final Name error;
  87     public final Name finalize;
  88     public final Name forRemoval;
  89     public final Name getClass;
  90     public final Name hasNext;
  91     public final Name hashCode;
  92     public final Name init;
  93     public final Name iterator;
  94     public final Name length;
  95     public final Name next;
  96     public final Name ordinal;
  97     public final Name provider;
  98     public final Name serialVersionUID;
  99     public final Name toString;
 100     public final Name value;
 101     public final Name valueOf;
 102     public final Name values;


 103 
 104     // class names
 105     public final Name java_io_Serializable;
 106     public final Name java_lang_Class;
 107     public final Name java_lang_Cloneable;
 108     public final Name java_lang_Enum;
 109     public final Name java_lang_Object;
 110 
 111     // names of builtin classes
 112     public final Name Array;
 113     public final Name Bound;
 114     public final Name Method;
 115 
 116     // package names
 117     public final Name java_lang;
 118 
 119     // module names
 120     public final Name java_base;
 121 
 122     // attribute names


 124     public final Name AnnotationDefault;
 125     public final Name BootstrapMethods;
 126     public final Name Bridge;
 127     public final Name CharacterRangeTable;
 128     public final Name Code;
 129     public final Name CompilationID;
 130     public final Name ConstantValue;
 131     public final Name Deprecated;
 132     public final Name EnclosingMethod;
 133     public final Name Enum;
 134     public final Name Exceptions;
 135     public final Name InnerClasses;
 136     public final Name LineNumberTable;
 137     public final Name LocalVariableTable;
 138     public final Name LocalVariableTypeTable;
 139     public final Name MethodParameters;
 140     public final Name Module;
 141     public final Name ModuleResolution;
 142     public final Name NestHost;
 143     public final Name NestMembers;

 144     public final Name RuntimeInvisibleAnnotations;
 145     public final Name RuntimeInvisibleParameterAnnotations;
 146     public final Name RuntimeInvisibleTypeAnnotations;
 147     public final Name RuntimeVisibleAnnotations;
 148     public final Name RuntimeVisibleParameterAnnotations;
 149     public final Name RuntimeVisibleTypeAnnotations;
 150     public final Name Signature;
 151     public final Name SourceFile;
 152     public final Name SourceID;
 153     public final Name StackMap;
 154     public final Name StackMapTable;
 155     public final Name Synthetic;
 156     public final Name Value;
 157     public final Name Varargs;

 158 
 159     // members of java.lang.annotation.ElementType
 160     public final Name ANNOTATION_TYPE;
 161     public final Name CONSTRUCTOR;
 162     public final Name FIELD;
 163     public final Name LOCAL_VARIABLE;
 164     public final Name METHOD;
 165     public final Name MODULE;
 166     public final Name PACKAGE;
 167     public final Name PARAMETER;
 168     public final Name TYPE;
 169     public final Name TYPE_PARAMETER;
 170     public final Name TYPE_USE;
 171 
 172     // members of java.lang.annotation.RetentionPolicy
 173     public final Name CLASS;
 174     public final Name RUNTIME;
 175     public final Name SOURCE;
 176 
 177     // other identifiers
 178     public final Name T;
 179     public final Name ex;
 180     public final Name module_info;
 181     public final Name package_info;
 182     public final Name requireNonNull;
 183 
 184     // lambda-related
 185     public final Name lambda;
 186     public final Name metafactory;
 187     public final Name altMetafactory;
 188     public final Name dollarThis;
 189 
 190     // string concat
 191     public final Name makeConcat;
 192     public final Name makeConcatWithConstants;
 193 













 194     public final Name.Table table;
 195 
 196     public Names(Context context) {
 197         Options options = Options.instance(context);
 198         table = createTable(options);
 199 
 200         // operators and punctuation
 201         asterisk = fromString("*");
 202         comma = fromString(",");
 203         empty = fromString("");
 204         hyphen = fromString("-");
 205         one = fromString("1");
 206         slash = fromString("/");
 207 
 208         // keywords
 209         _class = fromString("class");
 210         _super = fromString("super");
 211         _this = fromString("this");
 212         var = fromString("var");
 213         exports = fromString("exports");
 214         opens = fromString("opens");
 215         module = fromString("module");
 216         provides = fromString("provides");
 217         requires = fromString("requires");
 218         to = fromString("to");
 219         transitive = fromString("transitive");
 220         uses = fromString("uses");
 221         open = fromString("open");
 222         with = fromString("with");


 223         yield = fromString("yield");
 224 
 225         // field and method names
 226         _name = fromString("name");
 227         addSuppressed = fromString("addSuppressed");
 228         any = fromString("<any>");
 229         append = fromString("append");
 230         clinit = fromString("<clinit>");
 231         clone = fromString("clone");
 232         close = fromString("close");
 233         deserializeLambda = fromString("$deserializeLambda$");
 234         desiredAssertionStatus = fromString("desiredAssertionStatus");
 235         equals = fromString("equals");

 236         error = fromString("<error>");
 237         finalize = fromString("finalize");
 238         forRemoval = fromString("forRemoval");
 239         getClass = fromString("getClass");
 240         hasNext = fromString("hasNext");
 241         hashCode = fromString("hashCode");
 242         init = fromString("<init>");
 243         iterator = fromString("iterator");
 244         length = fromString("length");
 245         next = fromString("next");
 246         ordinal = fromString("ordinal");
 247         provider = fromString("provider");
 248         serialVersionUID = fromString("serialVersionUID");
 249         toString = fromString("toString");
 250         value = fromString("value");
 251         valueOf = fromString("valueOf");
 252         values = fromString("values");


 253         dollarThis = fromString("$this");
 254 
 255         // class names
 256         java_io_Serializable = fromString("java.io.Serializable");
 257         java_lang_Class = fromString("java.lang.Class");
 258         java_lang_Cloneable = fromString("java.lang.Cloneable");
 259         java_lang_Enum = fromString("java.lang.Enum");
 260         java_lang_Object = fromString("java.lang.Object");
 261 
 262         // names of builtin classes
 263         Array = fromString("Array");
 264         Bound = fromString("Bound");
 265         Method = fromString("Method");
 266 
 267         // package names
 268         java_lang = fromString("java.lang");
 269 
 270         // module names
 271         java_base = fromString("java.base");
 272 


 275         AnnotationDefault = fromString("AnnotationDefault");
 276         BootstrapMethods = fromString("BootstrapMethods");
 277         Bridge = fromString("Bridge");
 278         CharacterRangeTable = fromString("CharacterRangeTable");
 279         Code = fromString("Code");
 280         CompilationID = fromString("CompilationID");
 281         ConstantValue = fromString("ConstantValue");
 282         Deprecated = fromString("Deprecated");
 283         EnclosingMethod = fromString("EnclosingMethod");
 284         Enum = fromString("Enum");
 285         Exceptions = fromString("Exceptions");
 286         InnerClasses = fromString("InnerClasses");
 287         LineNumberTable = fromString("LineNumberTable");
 288         LocalVariableTable = fromString("LocalVariableTable");
 289         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
 290         MethodParameters = fromString("MethodParameters");
 291         Module = fromString("Module");
 292         ModuleResolution = fromString("ModuleResolution");
 293         NestHost = fromString("NestHost");
 294         NestMembers = fromString("NestMembers");

 295         RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
 296         RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
 297         RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
 298         RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations");
 299         RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
 300         RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations");
 301         Signature = fromString("Signature");
 302         SourceFile = fromString("SourceFile");
 303         SourceID = fromString("SourceID");
 304         StackMap = fromString("StackMap");
 305         StackMapTable = fromString("StackMapTable");
 306         Synthetic = fromString("Synthetic");
 307         Value = fromString("Value");
 308         Varargs = fromString("Varargs");

 309 
 310         // members of java.lang.annotation.ElementType
 311         ANNOTATION_TYPE = fromString("ANNOTATION_TYPE");
 312         CONSTRUCTOR = fromString("CONSTRUCTOR");
 313         FIELD = fromString("FIELD");
 314         LOCAL_VARIABLE = fromString("LOCAL_VARIABLE");
 315         METHOD = fromString("METHOD");
 316         MODULE = fromString("MODULE");
 317         PACKAGE = fromString("PACKAGE");
 318         PARAMETER = fromString("PARAMETER");
 319         TYPE = fromString("TYPE");
 320         TYPE_PARAMETER = fromString("TYPE_PARAMETER");
 321         TYPE_USE = fromString("TYPE_USE");
 322 
 323         // members of java.lang.annotation.RetentionPolicy
 324         CLASS = fromString("CLASS");
 325         RUNTIME = fromString("RUNTIME");
 326         SOURCE = fromString("SOURCE");
 327 
 328         // other identifiers
 329         T = fromString("T");
 330         ex = fromString("ex");
 331         module_info = fromString("module-info");
 332         package_info = fromString("package-info");
 333         requireNonNull = fromString("requireNonNull");
 334 
 335         //lambda-related
 336         lambda = fromString("lambda$");
 337         metafactory = fromString("metafactory");
 338         altMetafactory = fromString("altMetafactory");
 339 
 340         // string concat
 341         makeConcat = fromString("makeConcat");
 342         makeConcatWithConstants = fromString("makeConcatWithConstants");










 343     }
 344 
 345     protected Name.Table createTable(Options options) {
 346         boolean useUnsharedTable = options.isSet("useUnsharedTable");
 347         if (useUnsharedTable)
 348             return UnsharedNameTable.create(this);
 349         else
 350             return SharedNameTable.create(this);
 351     }
 352 
 353     public void dispose() {
 354         table.dispose();
 355     }
 356 
 357     public Name fromChars(char[] cs, int start, int len) {
 358         return table.fromChars(cs, start, len);
 359     }
 360 
 361     public Name fromString(String s) {
 362         return table.fromString(s);


  53     public final Name empty;
  54     public final Name hyphen;
  55     public final Name one;
  56     public final Name slash;
  57 
  58     // keywords
  59     public final Name _class;
  60     public final Name _super;
  61     public final Name _this;
  62     public final Name var;
  63     public final Name exports;
  64     public final Name opens;
  65     public final Name module;
  66     public final Name provides;
  67     public final Name requires;
  68     public final Name to;
  69     public final Name transitive;
  70     public final Name uses;
  71     public final Name open;
  72     public final Name with;
  73     public final Name get;
  74     public final Name set;
  75     public final Name yield;
  76 
  77     // field and method names
  78     public final Name _name;
  79     public final Name addSuppressed;
  80     public final Name any;
  81     public final Name append;
  82     public final Name clinit;
  83     public final Name clone;
  84     public final Name close;
  85     public final Name deserializeLambda;
  86     public final Name desiredAssertionStatus;
  87     public final Name equals;
  88     public final Name oldEquals;
  89     public final Name error;
  90     public final Name finalize;
  91     public final Name forRemoval;
  92     public final Name getClass;
  93     public final Name hasNext;
  94     public final Name hashCode;
  95     public final Name init;
  96     public final Name iterator;
  97     public final Name length;
  98     public final Name next;
  99     public final Name ordinal;
 100     public final Name provider;
 101     public final Name serialVersionUID;
 102     public final Name toString;
 103     public final Name value;
 104     public final Name valueOf;
 105     public final Name values;
 106     public final Name readResolve;
 107     public final Name readObject;
 108 
 109     // class names
 110     public final Name java_io_Serializable;
 111     public final Name java_lang_Class;
 112     public final Name java_lang_Cloneable;
 113     public final Name java_lang_Enum;
 114     public final Name java_lang_Object;
 115 
 116     // names of builtin classes
 117     public final Name Array;
 118     public final Name Bound;
 119     public final Name Method;
 120 
 121     // package names
 122     public final Name java_lang;
 123 
 124     // module names
 125     public final Name java_base;
 126 
 127     // attribute names


 129     public final Name AnnotationDefault;
 130     public final Name BootstrapMethods;
 131     public final Name Bridge;
 132     public final Name CharacterRangeTable;
 133     public final Name Code;
 134     public final Name CompilationID;
 135     public final Name ConstantValue;
 136     public final Name Deprecated;
 137     public final Name EnclosingMethod;
 138     public final Name Enum;
 139     public final Name Exceptions;
 140     public final Name InnerClasses;
 141     public final Name LineNumberTable;
 142     public final Name LocalVariableTable;
 143     public final Name LocalVariableTypeTable;
 144     public final Name MethodParameters;
 145     public final Name Module;
 146     public final Name ModuleResolution;
 147     public final Name NestHost;
 148     public final Name NestMembers;
 149     public final Name Record;
 150     public final Name RuntimeInvisibleAnnotations;
 151     public final Name RuntimeInvisibleParameterAnnotations;
 152     public final Name RuntimeInvisibleTypeAnnotations;
 153     public final Name RuntimeVisibleAnnotations;
 154     public final Name RuntimeVisibleParameterAnnotations;
 155     public final Name RuntimeVisibleTypeAnnotations;
 156     public final Name Signature;
 157     public final Name SourceFile;
 158     public final Name SourceID;
 159     public final Name StackMap;
 160     public final Name StackMapTable;
 161     public final Name Synthetic;
 162     public final Name Value;
 163     public final Name Varargs;
 164     public final Name PermittedSubtypes;
 165 
 166     // members of java.lang.annotation.ElementType
 167     public final Name ANNOTATION_TYPE;
 168     public final Name CONSTRUCTOR;
 169     public final Name FIELD;
 170     public final Name LOCAL_VARIABLE;
 171     public final Name METHOD;
 172     public final Name MODULE;
 173     public final Name PACKAGE;
 174     public final Name PARAMETER;
 175     public final Name TYPE;
 176     public final Name TYPE_PARAMETER;
 177     public final Name TYPE_USE;
 178 
 179     // members of java.lang.annotation.RetentionPolicy
 180     public final Name CLASS;
 181     public final Name RUNTIME;
 182     public final Name SOURCE;
 183 
 184     // other identifiers
 185     public final Name T;
 186     public final Name ex;
 187     public final Name module_info;
 188     public final Name package_info;
 189     public final Name requireNonNull;
 190 
 191     // lambda-related
 192     public final Name lambda;
 193     public final Name metafactory;
 194     public final Name altMetafactory;
 195     public final Name dollarThis;
 196 
 197     // string concat
 198     public final Name makeConcat;
 199     public final Name makeConcatWithConstants;
 200 
 201     // record related
 202     // members of java.lang.invoke.ObjectMethodBuilders
 203     public final Name bootstrap;
 204 
 205     public final Name record;
 206     public final Name where;
 207     public final Name non;
 208     public final Name ofLazyProjection;
 209 
 210     // sealed types
 211     public final Name permits;
 212     public final Name sealed;
 213 
 214     public final Name.Table table;
 215 
 216     public Names(Context context) {
 217         Options options = Options.instance(context);
 218         table = createTable(options);
 219 
 220         // operators and punctuation
 221         asterisk = fromString("*");
 222         comma = fromString(",");
 223         empty = fromString("");
 224         hyphen = fromString("-");
 225         one = fromString("1");
 226         slash = fromString("/");
 227 
 228         // keywords
 229         _class = fromString("class");
 230         _super = fromString("super");
 231         _this = fromString("this");
 232         var = fromString("var");
 233         exports = fromString("exports");
 234         opens = fromString("opens");
 235         module = fromString("module");
 236         provides = fromString("provides");
 237         requires = fromString("requires");
 238         to = fromString("to");
 239         transitive = fromString("transitive");
 240         uses = fromString("uses");
 241         open = fromString("open");
 242         with = fromString("with");
 243         get = fromString("get");
 244         set = fromString("set");
 245         yield = fromString("yield");
 246 
 247         // field and method names
 248         _name = fromString("name");
 249         addSuppressed = fromString("addSuppressed");
 250         any = fromString("<any>");
 251         append = fromString("append");
 252         clinit = fromString("<clinit>");
 253         clone = fromString("clone");
 254         close = fromString("close");
 255         deserializeLambda = fromString("$deserializeLambda$");
 256         desiredAssertionStatus = fromString("desiredAssertionStatus");
 257         equals = fromString("equals");
 258         oldEquals = fromString("oldEquals");
 259         error = fromString("<error>");
 260         finalize = fromString("finalize");
 261         forRemoval = fromString("forRemoval");
 262         getClass = fromString("getClass");
 263         hasNext = fromString("hasNext");
 264         hashCode = fromString("hashCode");
 265         init = fromString("<init>");
 266         iterator = fromString("iterator");
 267         length = fromString("length");
 268         next = fromString("next");
 269         ordinal = fromString("ordinal");
 270         provider = fromString("provider");
 271         serialVersionUID = fromString("serialVersionUID");
 272         toString = fromString("toString");
 273         value = fromString("value");
 274         valueOf = fromString("valueOf");
 275         values = fromString("values");
 276         readResolve = fromString("readResolve");
 277         readObject = fromString("readObject");
 278         dollarThis = fromString("$this");
 279 
 280         // class names
 281         java_io_Serializable = fromString("java.io.Serializable");
 282         java_lang_Class = fromString("java.lang.Class");
 283         java_lang_Cloneable = fromString("java.lang.Cloneable");
 284         java_lang_Enum = fromString("java.lang.Enum");
 285         java_lang_Object = fromString("java.lang.Object");
 286 
 287         // names of builtin classes
 288         Array = fromString("Array");
 289         Bound = fromString("Bound");
 290         Method = fromString("Method");
 291 
 292         // package names
 293         java_lang = fromString("java.lang");
 294 
 295         // module names
 296         java_base = fromString("java.base");
 297 


 300         AnnotationDefault = fromString("AnnotationDefault");
 301         BootstrapMethods = fromString("BootstrapMethods");
 302         Bridge = fromString("Bridge");
 303         CharacterRangeTable = fromString("CharacterRangeTable");
 304         Code = fromString("Code");
 305         CompilationID = fromString("CompilationID");
 306         ConstantValue = fromString("ConstantValue");
 307         Deprecated = fromString("Deprecated");
 308         EnclosingMethod = fromString("EnclosingMethod");
 309         Enum = fromString("Enum");
 310         Exceptions = fromString("Exceptions");
 311         InnerClasses = fromString("InnerClasses");
 312         LineNumberTable = fromString("LineNumberTable");
 313         LocalVariableTable = fromString("LocalVariableTable");
 314         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
 315         MethodParameters = fromString("MethodParameters");
 316         Module = fromString("Module");
 317         ModuleResolution = fromString("ModuleResolution");
 318         NestHost = fromString("NestHost");
 319         NestMembers = fromString("NestMembers");
 320         Record = fromString("Record");
 321         RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
 322         RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
 323         RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
 324         RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations");
 325         RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
 326         RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations");
 327         Signature = fromString("Signature");
 328         SourceFile = fromString("SourceFile");
 329         SourceID = fromString("SourceID");
 330         StackMap = fromString("StackMap");
 331         StackMapTable = fromString("StackMapTable");
 332         Synthetic = fromString("Synthetic");
 333         Value = fromString("Value");
 334         Varargs = fromString("Varargs");
 335         PermittedSubtypes = fromString("PermittedSubtypes");
 336 
 337         // members of java.lang.annotation.ElementType
 338         ANNOTATION_TYPE = fromString("ANNOTATION_TYPE");
 339         CONSTRUCTOR = fromString("CONSTRUCTOR");
 340         FIELD = fromString("FIELD");
 341         LOCAL_VARIABLE = fromString("LOCAL_VARIABLE");
 342         METHOD = fromString("METHOD");
 343         MODULE = fromString("MODULE");
 344         PACKAGE = fromString("PACKAGE");
 345         PARAMETER = fromString("PARAMETER");
 346         TYPE = fromString("TYPE");
 347         TYPE_PARAMETER = fromString("TYPE_PARAMETER");
 348         TYPE_USE = fromString("TYPE_USE");
 349 
 350         // members of java.lang.annotation.RetentionPolicy
 351         CLASS = fromString("CLASS");
 352         RUNTIME = fromString("RUNTIME");
 353         SOURCE = fromString("SOURCE");
 354 
 355         // other identifiers
 356         T = fromString("T");
 357         ex = fromString("ex");
 358         module_info = fromString("module-info");
 359         package_info = fromString("package-info");
 360         requireNonNull = fromString("requireNonNull");
 361 
 362         //lambda-related
 363         lambda = fromString("lambda$");
 364         metafactory = fromString("metafactory");
 365         altMetafactory = fromString("altMetafactory");
 366 
 367         // string concat
 368         makeConcat = fromString("makeConcat");
 369         makeConcatWithConstants = fromString("makeConcatWithConstants");
 370 
 371         bootstrap = fromString("bootstrap");
 372         record = fromString("record");
 373         where = fromString("where");
 374         non = fromString("non");
 375         ofLazyProjection = fromString("ofLazyProjection");
 376 
 377         // sealed types
 378         permits = fromString("permits");
 379         sealed = fromString("sealed");
 380     }
 381 
 382     protected Name.Table createTable(Options options) {
 383         boolean useUnsharedTable = options.isSet("useUnsharedTable");
 384         if (useUnsharedTable)
 385             return UnsharedNameTable.create(this);
 386         else
 387             return SharedNameTable.create(this);
 388     }
 389 
 390     public void dispose() {
 391         table.dispose();
 392     }
 393 
 394     public Name fromChars(char[] cs, int start, int len) {
 395         return table.fromChars(cs, start, len);
 396     }
 397 
 398     public Name fromString(String s) {
 399         return table.fromString(s);
< prev index next >