< prev index next >

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

Print this page

 40 
 41     public static Names instance(Context context) {
 42         Names instance = context.get(namesKey);
 43         if (instance == null) {
 44             instance = new Names(context);
 45             context.put(namesKey, instance);
 46         }
 47         return instance;
 48     }
 49 
 50     // operators and punctuation
 51     public final Name asterisk;
 52     public final Name comma;
 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 when;
 73     public final Name with;
 74     public final Name yield;
 75 
 76     // field and method names
 77     public final Name _name;
 78     public final Name addSuppressed;
 79     public final Name any;

 83     public final Name close;
 84     public final Name deserializeLambda;
 85     public final Name desiredAssertionStatus;
 86     public final Name equals;
 87     public final Name error;
 88     public final Name finalize;
 89     public final Name forRemoval;
 90     public final Name reflective;
 91     public final Name getClass;
 92     public final Name hasNext;
 93     public final Name hashCode;
 94     public final Name init;
 95     public final Name iterator;
 96     public final Name length;
 97     public final Name next;
 98     public final Name ordinal;
 99     public final Name provider;
100     public final Name serialVersionUID;
101     public final Name toString;
102     public final Name value;


103     public final Name valueOf;
104     public final Name values;
105     public final Name readResolve;
106     public final Name readObject;

107 
108     // class names
109     public final Name java_io_Serializable;
110     public final Name java_lang_Class;
111     public final Name java_lang_Cloneable;
112     public final Name java_lang_Enum;
113     public final Name java_lang_Object;

114 
115     // names of builtin classes
116     public final Name Array;
117     public final Name Bound;
118     public final Name Method;
119 
120     // package names
121     public final Name java;
122     public final Name java_lang;
123     public final Name jdk_internal_javac;
124 
125     // module names
126     public final Name java_base;
127     public final Name jdk_unsupported;
128 
129     // attribute names
130     public final Name Annotation;
131     public final Name AnnotationDefault;
132     public final Name BootstrapMethods;
133     public final Name Bridge;
134     public final Name CharacterRangeTable;
135     public final Name Code;
136     public final Name CompilationID;
137     public final Name ConstantValue;
138     public final Name Deprecated;
139     public final Name EnclosingMethod;
140     public final Name Enum;
141     public final Name Exceptions;
142     public final Name InnerClasses;
143     public final Name LineNumberTable;
144     public final Name LocalVariableTable;
145     public final Name LocalVariableTypeTable;
146     public final Name MethodParameters;
147     public final Name Module;
148     public final Name ModuleResolution;
149     public final Name NestHost;
150     public final Name NestMembers;

151     public final Name Record;
152     public final Name RuntimeInvisibleAnnotations;
153     public final Name RuntimeInvisibleParameterAnnotations;
154     public final Name RuntimeInvisibleTypeAnnotations;
155     public final Name RuntimeVisibleAnnotations;
156     public final Name RuntimeVisibleParameterAnnotations;
157     public final Name RuntimeVisibleTypeAnnotations;
158     public final Name Signature;
159     public final Name SourceFile;
160     public final Name SourceID;
161     public final Name StackMap;
162     public final Name StackMapTable;
163     public final Name Synthetic;
164     public final Name Value;
165     public final Name Varargs;
166     public final Name PermittedSubclasses;
167 
168     // members of java.lang.annotation.ElementType
169     public final Name ANNOTATION_TYPE;
170     public final Name CONSTRUCTOR;

184     public final Name RUNTIME;
185     public final Name SOURCE;
186 
187     // other identifiers
188     public final Name T;
189     public final Name ex;
190     public final Name module_info;
191     public final Name package_info;
192     public final Name requireNonNull;
193 
194     // lambda-related
195     public final Name lambda;
196     public final Name metafactory;
197     public final Name altMetafactory;
198     public final Name dollarThis;
199 
200     // string concat
201     public final Name makeConcat;
202     public final Name makeConcatWithConstants;
203 






204     // record related
205     // members of java.lang.runtime.ObjectMethods
206     public final Name bootstrap;
207 
208     public final Name record;
209     public final Name non;
210 
211     // serialization members, used by records too
212     public final Name serialPersistentFields;
213     public final Name writeObject;
214     public final Name writeReplace;
215     public final Name readObjectNoData;
216 
217     // sealed types
218     public final Name permits;
219     public final Name sealed;
220 
221     // pattern switches
222     public final Name typeSwitch;
223     public final Name enumSwitch;
224 
225     public final Name.Table table;
226 
227     public Names(Context context) {
228         Options options = Options.instance(context);
229         table = createTable(options);
230 
231         // operators and punctuation
232         asterisk = fromString("*");
233         comma = fromString(",");
234         empty = fromString("");
235         hyphen = fromString("-");
236         one = fromString("1");
237         slash = fromString("/");
238 
239         // keywords
240         _class = fromString("class");

241         _super = fromString("super");
242         _this = fromString("this");
243         var = fromString("var");
244         exports = fromString("exports");
245         opens = fromString("opens");
246         module = fromString("module");
247         provides = fromString("provides");
248         requires = fromString("requires");
249         to = fromString("to");
250         transitive = fromString("transitive");
251         uses = fromString("uses");
252         open = fromString("open");
253         when = fromString("when");
254         with = fromString("with");
255         yield = fromString("yield");
256 
257         // field and method names
258         _name = fromString("name");
259         addSuppressed = fromString("addSuppressed");
260         any = fromString("<any>");

264         close = fromString("close");
265         deserializeLambda = fromString("$deserializeLambda$");
266         desiredAssertionStatus = fromString("desiredAssertionStatus");
267         equals = fromString("equals");
268         error = fromString("<error>");
269         finalize = fromString("finalize");
270         forRemoval = fromString("forRemoval");
271         reflective = fromString("reflective");
272         getClass = fromString("getClass");
273         hasNext = fromString("hasNext");
274         hashCode = fromString("hashCode");
275         init = fromString("<init>");
276         iterator = fromString("iterator");
277         length = fromString("length");
278         next = fromString("next");
279         ordinal = fromString("ordinal");
280         provider = fromString("provider");
281         serialVersionUID = fromString("serialVersionUID");
282         toString = fromString("toString");
283         value = fromString("value");


284         valueOf = fromString("valueOf");
285         values = fromString("values");
286         readResolve = fromString("readResolve");
287         readObject = fromString("readObject");

288         dollarThis = fromString("$this");
289 
290         // class names
291         java_io_Serializable = fromString("java.io.Serializable");
292         java_lang_Class = fromString("java.lang.Class");
293         java_lang_Cloneable = fromString("java.lang.Cloneable");
294         java_lang_Enum = fromString("java.lang.Enum");
295         java_lang_Object = fromString("java.lang.Object");

296 
297         // names of builtin classes
298         Array = fromString("Array");
299         Bound = fromString("Bound");
300         Method = fromString("Method");
301 
302         // package names
303         java = fromString("java");
304         java_lang = fromString("java.lang");
305         jdk_internal_javac = fromString("jdk.internal.javac");
306 
307         // module names
308         java_base = fromString("java.base");
309         jdk_unsupported = fromString("jdk.unsupported");
310 
311         // attribute names
312         Annotation = fromString("Annotation");
313         AnnotationDefault = fromString("AnnotationDefault");
314         BootstrapMethods = fromString("BootstrapMethods");
315         Bridge = fromString("Bridge");
316         CharacterRangeTable = fromString("CharacterRangeTable");
317         Code = fromString("Code");
318         CompilationID = fromString("CompilationID");
319         ConstantValue = fromString("ConstantValue");
320         Deprecated = fromString("Deprecated");
321         EnclosingMethod = fromString("EnclosingMethod");
322         Enum = fromString("Enum");
323         Exceptions = fromString("Exceptions");
324         InnerClasses = fromString("InnerClasses");
325         LineNumberTable = fromString("LineNumberTable");
326         LocalVariableTable = fromString("LocalVariableTable");
327         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
328         MethodParameters = fromString("MethodParameters");
329         Module = fromString("Module");
330         ModuleResolution = fromString("ModuleResolution");
331         NestHost = fromString("NestHost");
332         NestMembers = fromString("NestMembers");

333         Record = fromString("Record");
334         RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
335         RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
336         RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
337         RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations");
338         RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
339         RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations");
340         Signature = fromString("Signature");
341         SourceFile = fromString("SourceFile");
342         SourceID = fromString("SourceID");
343         StackMap = fromString("StackMap");
344         StackMapTable = fromString("StackMapTable");
345         Synthetic = fromString("Synthetic");
346         Value = fromString("Value");
347         Varargs = fromString("Varargs");
348         PermittedSubclasses = fromString("PermittedSubclasses");
349 
350         // members of java.lang.annotation.ElementType
351         ANNOTATION_TYPE = fromString("ANNOTATION_TYPE");
352         CONSTRUCTOR = fromString("CONSTRUCTOR");

365         CLASS = fromString("CLASS");
366         RUNTIME = fromString("RUNTIME");
367         SOURCE = fromString("SOURCE");
368 
369         // other identifiers
370         T = fromString("T");
371         ex = fromString("ex");
372         module_info = fromString("module-info");
373         package_info = fromString("package-info");
374         requireNonNull = fromString("requireNonNull");
375 
376         //lambda-related
377         lambda = fromString("lambda$");
378         metafactory = fromString("metafactory");
379         altMetafactory = fromString("altMetafactory");
380 
381         // string concat
382         makeConcat = fromString("makeConcat");
383         makeConcatWithConstants = fromString("makeConcatWithConstants");
384 





385         bootstrap = fromString("bootstrap");
386         record = fromString("record");
387         non = fromString("non");
388 
389         serialPersistentFields = fromString("serialPersistentFields");
390         writeObject = fromString("writeObject");
391         writeReplace = fromString("writeReplace");
392         readObjectNoData = fromString("readObjectNoData");
393 
394         // sealed types
395         permits = fromString("permits");
396         sealed = fromString("sealed");
397 
398         // pattern switches
399         typeSwitch = fromString("typeSwitch");
400         enumSwitch = fromString("enumSwitch");
401     }
402 
403     protected Name.Table createTable(Options options) {
404         boolean useUnsharedTable = options.isSet("useUnsharedTable");

 40 
 41     public static Names instance(Context context) {
 42         Names instance = context.get(namesKey);
 43         if (instance == null) {
 44             instance = new Names(context);
 45             context.put(namesKey, instance);
 46         }
 47         return instance;
 48     }
 49 
 50     // operators and punctuation
 51     public final Name asterisk;
 52     public final Name comma;
 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 _default;
 61     public final Name _super;
 62     public final Name _this;
 63     public final Name var;
 64     public final Name exports;
 65     public final Name opens;
 66     public final Name module;
 67     public final Name provides;
 68     public final Name requires;
 69     public final Name to;
 70     public final Name transitive;
 71     public final Name uses;
 72     public final Name open;
 73     public final Name when;
 74     public final Name with;
 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;

 84     public final Name close;
 85     public final Name deserializeLambda;
 86     public final Name desiredAssertionStatus;
 87     public final Name equals;
 88     public final Name error;
 89     public final Name finalize;
 90     public final Name forRemoval;
 91     public final Name reflective;
 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 primitive;
105     public final Name identity;
106     public final Name valueOf;
107     public final Name values;
108     public final Name readResolve;
109     public final Name readObject;
110     public final Name isValueObject;
111 
112     // class names
113     public final Name java_io_Serializable;
114     public final Name java_lang_Class;
115     public final Name java_lang_Cloneable;
116     public final Name java_lang_Enum;
117     public final Name java_lang_Object;
118     public final Name java_lang_System;
119 
120     // names of builtin classes
121     public final Name Array;
122     public final Name Bound;
123     public final Name Method;
124 
125     // package names
126     public final Name java;
127     public final Name java_lang;
128     public final Name jdk_internal_javac;
129 
130     // module names
131     public final Name java_base;
132     public final Name jdk_unsupported;
133 
134     // attribute names
135     public final Name Annotation;
136     public final Name AnnotationDefault;
137     public final Name BootstrapMethods;
138     public final Name Bridge;
139     public final Name CharacterRangeTable;
140     public final Name Code;
141     public final Name CompilationID;
142     public final Name ConstantValue;
143     public final Name Deprecated;
144     public final Name EnclosingMethod;
145     public final Name Enum;
146     public final Name Exceptions;
147     public final Name InnerClasses;
148     public final Name LineNumberTable;
149     public final Name LocalVariableTable;
150     public final Name LocalVariableTypeTable;
151     public final Name MethodParameters;
152     public final Name Module;
153     public final Name ModuleResolution;
154     public final Name NestHost;
155     public final Name NestMembers;
156     public final Name Preload;
157     public final Name Record;
158     public final Name RuntimeInvisibleAnnotations;
159     public final Name RuntimeInvisibleParameterAnnotations;
160     public final Name RuntimeInvisibleTypeAnnotations;
161     public final Name RuntimeVisibleAnnotations;
162     public final Name RuntimeVisibleParameterAnnotations;
163     public final Name RuntimeVisibleTypeAnnotations;
164     public final Name Signature;
165     public final Name SourceFile;
166     public final Name SourceID;
167     public final Name StackMap;
168     public final Name StackMapTable;
169     public final Name Synthetic;
170     public final Name Value;
171     public final Name Varargs;
172     public final Name PermittedSubclasses;
173 
174     // members of java.lang.annotation.ElementType
175     public final Name ANNOTATION_TYPE;
176     public final Name CONSTRUCTOR;

190     public final Name RUNTIME;
191     public final Name SOURCE;
192 
193     // other identifiers
194     public final Name T;
195     public final Name ex;
196     public final Name module_info;
197     public final Name package_info;
198     public final Name requireNonNull;
199 
200     // lambda-related
201     public final Name lambda;
202     public final Name metafactory;
203     public final Name altMetafactory;
204     public final Name dollarThis;
205 
206     // string concat
207     public final Name makeConcat;
208     public final Name makeConcatWithConstants;
209 
210     // values
211     public final Name dollarValue;
212     public final Name ref;
213     public final Name val;
214 
215 
216     // record related
217     // members of java.lang.runtime.ObjectMethods
218     public final Name bootstrap;
219 
220     public final Name record;
221     public final Name non;
222 
223     // serialization members, used by records too
224     public final Name serialPersistentFields;
225     public final Name writeObject;
226     public final Name writeReplace;
227     public final Name readObjectNoData;
228 
229     // sealed types
230     public final Name permits;
231     public final Name sealed;
232 
233     // pattern switches
234     public final Name typeSwitch;
235     public final Name enumSwitch;
236 
237     public final Name.Table table;
238 
239     public Names(Context context) {
240         Options options = Options.instance(context);
241         table = createTable(options);
242 
243         // operators and punctuation
244         asterisk = fromString("*");
245         comma = fromString(",");
246         empty = fromString("");
247         hyphen = fromString("-");
248         one = fromString("1");
249         slash = fromString("/");
250 
251         // keywords
252         _class = fromString("class");
253         _default = fromString("default");
254         _super = fromString("super");
255         _this = fromString("this");
256         var = fromString("var");
257         exports = fromString("exports");
258         opens = fromString("opens");
259         module = fromString("module");
260         provides = fromString("provides");
261         requires = fromString("requires");
262         to = fromString("to");
263         transitive = fromString("transitive");
264         uses = fromString("uses");
265         open = fromString("open");
266         when = fromString("when");
267         with = fromString("with");
268         yield = fromString("yield");
269 
270         // field and method names
271         _name = fromString("name");
272         addSuppressed = fromString("addSuppressed");
273         any = fromString("<any>");

277         close = fromString("close");
278         deserializeLambda = fromString("$deserializeLambda$");
279         desiredAssertionStatus = fromString("desiredAssertionStatus");
280         equals = fromString("equals");
281         error = fromString("<error>");
282         finalize = fromString("finalize");
283         forRemoval = fromString("forRemoval");
284         reflective = fromString("reflective");
285         getClass = fromString("getClass");
286         hasNext = fromString("hasNext");
287         hashCode = fromString("hashCode");
288         init = fromString("<init>");
289         iterator = fromString("iterator");
290         length = fromString("length");
291         next = fromString("next");
292         ordinal = fromString("ordinal");
293         provider = fromString("provider");
294         serialVersionUID = fromString("serialVersionUID");
295         toString = fromString("toString");
296         value = fromString("value");
297         primitive = fromString("primitive");
298         identity = fromString("identity");
299         valueOf = fromString("valueOf");
300         values = fromString("values");
301         readResolve = fromString("readResolve");
302         readObject = fromString("readObject");
303         isValueObject = fromString("isValueObject");
304         dollarThis = fromString("$this");
305 
306         // class names
307         java_io_Serializable = fromString("java.io.Serializable");
308         java_lang_Class = fromString("java.lang.Class");
309         java_lang_Cloneable = fromString("java.lang.Cloneable");
310         java_lang_Enum = fromString("java.lang.Enum");
311         java_lang_Object = fromString("java.lang.Object");
312         java_lang_System = fromString("java.lang.System");
313 
314         // names of builtin classes
315         Array = fromString("Array");
316         Bound = fromString("Bound");
317         Method = fromString("Method");
318 
319         // package names
320         java = fromString("java");
321         java_lang = fromString("java.lang");
322         jdk_internal_javac = fromString("jdk.internal.javac");
323 
324         // module names
325         java_base = fromString("java.base");
326         jdk_unsupported = fromString("jdk.unsupported");
327 
328         // attribute names
329         Annotation = fromString("Annotation");
330         AnnotationDefault = fromString("AnnotationDefault");
331         BootstrapMethods = fromString("BootstrapMethods");
332         Bridge = fromString("Bridge");
333         CharacterRangeTable = fromString("CharacterRangeTable");
334         Code = fromString("Code");
335         CompilationID = fromString("CompilationID");
336         ConstantValue = fromString("ConstantValue");
337         Deprecated = fromString("Deprecated");
338         EnclosingMethod = fromString("EnclosingMethod");
339         Enum = fromString("Enum");
340         Exceptions = fromString("Exceptions");
341         InnerClasses = fromString("InnerClasses");
342         LineNumberTable = fromString("LineNumberTable");
343         LocalVariableTable = fromString("LocalVariableTable");
344         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
345         MethodParameters = fromString("MethodParameters");
346         Module = fromString("Module");
347         ModuleResolution = fromString("ModuleResolution");
348         NestHost = fromString("NestHost");
349         NestMembers = fromString("NestMembers");
350         Preload = fromString("Preload");
351         Record = fromString("Record");
352         RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
353         RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
354         RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
355         RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations");
356         RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
357         RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations");
358         Signature = fromString("Signature");
359         SourceFile = fromString("SourceFile");
360         SourceID = fromString("SourceID");
361         StackMap = fromString("StackMap");
362         StackMapTable = fromString("StackMapTable");
363         Synthetic = fromString("Synthetic");
364         Value = fromString("Value");
365         Varargs = fromString("Varargs");
366         PermittedSubclasses = fromString("PermittedSubclasses");
367 
368         // members of java.lang.annotation.ElementType
369         ANNOTATION_TYPE = fromString("ANNOTATION_TYPE");
370         CONSTRUCTOR = fromString("CONSTRUCTOR");

383         CLASS = fromString("CLASS");
384         RUNTIME = fromString("RUNTIME");
385         SOURCE = fromString("SOURCE");
386 
387         // other identifiers
388         T = fromString("T");
389         ex = fromString("ex");
390         module_info = fromString("module-info");
391         package_info = fromString("package-info");
392         requireNonNull = fromString("requireNonNull");
393 
394         //lambda-related
395         lambda = fromString("lambda$");
396         metafactory = fromString("metafactory");
397         altMetafactory = fromString("altMetafactory");
398 
399         // string concat
400         makeConcat = fromString("makeConcat");
401         makeConcatWithConstants = fromString("makeConcatWithConstants");
402 
403         // primitive classes
404         dollarValue = fromString("$value");
405         ref = fromString("ref");
406         val = fromString("val");
407 
408         bootstrap = fromString("bootstrap");
409         record = fromString("record");
410         non = fromString("non");
411 
412         serialPersistentFields = fromString("serialPersistentFields");
413         writeObject = fromString("writeObject");
414         writeReplace = fromString("writeReplace");
415         readObjectNoData = fromString("readObjectNoData");
416 
417         // sealed types
418         permits = fromString("permits");
419         sealed = fromString("sealed");
420 
421         // pattern switches
422         typeSwitch = fromString("typeSwitch");
423         enumSwitch = fromString("enumSwitch");
424     }
425 
426     protected Name.Table createTable(Options options) {
427         boolean useUnsharedTable = options.isSet("useUnsharedTable");
< prev index next >