< 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 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 reflective;
 90     public final Name getClass;
 91     public final Name hasNext;
 92     public final Name hashCode;
 93     public final Name init;
 94     public final Name iterator;
 95     public final Name length;

 96     public final Name next;
 97     public final Name ordinal;
 98     public final Name provider;
 99     public final Name serialVersionUID;
100     public final Name toString;
101     public final Name value;

102     public final Name valueOf;
103     public final Name values;
104     public final Name readResolve;
105     public final Name readObject;
106 
107     // class names
108     public final Name java_io_Serializable;
109     public final Name java_lang_Class;
110     public final Name java_lang_Cloneable;
111     public final Name java_lang_Enum;
112     public final Name java_lang_Object;




113 
114     // names of builtin classes
115     public final Name Array;
116     public final Name Bound;
117     public final Name Method;
118 
119     // package names
120     public final Name java;
121     public final Name java_lang;
122 
123     // module names
124     public final Name java_base;
125     public final Name jdk_unsupported;
126 
127     // attribute names
128     public final Name Annotation;
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;

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






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

239         _super = fromString("super");
240         _this = fromString("this");
241         var = fromString("var");
242         exports = fromString("exports");
243         opens = fromString("opens");
244         module = fromString("module");
245         provides = fromString("provides");
246         requires = fromString("requires");
247         to = fromString("to");
248         transitive = fromString("transitive");
249         uses = fromString("uses");
250         open = fromString("open");
251         with = fromString("with");
252         yield = fromString("yield");
253 
254         // field and method names
255         _name = fromString("name");
256         addSuppressed = fromString("addSuppressed");
257         any = fromString("<any>");
258         append = fromString("append");
259         clinit = fromString("<clinit>");
260         clone = fromString("clone");
261         close = fromString("close");
262         deserializeLambda = fromString("$deserializeLambda$");
263         desiredAssertionStatus = fromString("desiredAssertionStatus");
264         equals = fromString("equals");
265         error = fromString("<error>");
266         finalize = fromString("finalize");
267         forRemoval = fromString("forRemoval");
268         reflective = fromString("reflective");
269         getClass = fromString("getClass");
270         hasNext = fromString("hasNext");
271         hashCode = fromString("hashCode");
272         init = fromString("<init>");
273         iterator = fromString("iterator");
274         length = fromString("length");
275         next = fromString("next");

276         ordinal = fromString("ordinal");
277         provider = fromString("provider");
278         serialVersionUID = fromString("serialVersionUID");
279         toString = fromString("toString");
280         value = fromString("value");

281         valueOf = fromString("valueOf");
282         values = fromString("values");
283         readResolve = fromString("readResolve");
284         readObject = fromString("readObject");
285         dollarThis = fromString("$this");
286 
287         // class names
288         java_io_Serializable = fromString("java.io.Serializable");
289         java_lang_Class = fromString("java.lang.Class");
290         java_lang_Cloneable = fromString("java.lang.Cloneable");
291         java_lang_Enum = fromString("java.lang.Enum");
292         java_lang_Object = fromString("java.lang.Object");




293 
294         // names of builtin classes
295         Array = fromString("Array");
296         Bound = fromString("Bound");
297         Method = fromString("Method");
298 
299         // package names
300         java = fromString("java");
301         java_lang = fromString("java.lang");
302 
303         // module names
304         java_base = fromString("java.base");
305         jdk_unsupported = fromString("jdk.unsupported");
306 
307         // attribute names
308         Annotation = fromString("Annotation");
309         AnnotationDefault = fromString("AnnotationDefault");
310         BootstrapMethods = fromString("BootstrapMethods");
311         Bridge = fromString("Bridge");
312         CharacterRangeTable = fromString("CharacterRangeTable");
313         Code = fromString("Code");
314         CompilationID = fromString("CompilationID");
315         ConstantValue = fromString("ConstantValue");
316         Deprecated = fromString("Deprecated");
317         EnclosingMethod = fromString("EnclosingMethod");
318         Enum = fromString("Enum");
319         Exceptions = fromString("Exceptions");
320         InnerClasses = fromString("InnerClasses");
321         LineNumberTable = fromString("LineNumberTable");

322         LocalVariableTable = fromString("LocalVariableTable");
323         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
324         MethodParameters = fromString("MethodParameters");
325         Module = fromString("Module");
326         ModuleResolution = fromString("ModuleResolution");
327         NestHost = fromString("NestHost");
328         NestMembers = fromString("NestMembers");
329         Record = fromString("Record");
330         RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
331         RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
332         RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
333         RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations");
334         RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
335         RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations");
336         Signature = fromString("Signature");
337         SourceFile = fromString("SourceFile");
338         SourceID = fromString("SourceID");
339         StackMap = fromString("StackMap");
340         StackMapTable = fromString("StackMapTable");
341         Synthetic = fromString("Synthetic");

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





381         bootstrap = fromString("bootstrap");
382         record = fromString("record");
383         non = fromString("non");
384 
385         serialPersistentFields = fromString("serialPersistentFields");
386         writeObject = fromString("writeObject");
387         writeReplace = fromString("writeReplace");
388         readObjectNoData = fromString("readObjectNoData");
389 
390         // sealed types
391         permits = fromString("permits");
392         sealed = fromString("sealed");
393 
394         // pattern switches
395         typeSwitch = fromString("typeSwitch");
396         enumSwitch = fromString("enumSwitch");
397     }
398 
399     protected Name.Table createTable(Options options) {
400         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 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;
 80     public final Name append;
 81     public final Name clinit;
 82     public final Name clone;
 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 newIdentity;
 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 valueOf;
106     public final Name values;
107     public final Name readResolve;
108     public final Name readObject;
109 
110     // class names
111     public final Name java_io_Serializable;
112     public final Name java_lang_Class;
113     public final Name java_lang_Cloneable;
114     public final Name java_lang_Enum;
115     public final Name java_lang_Object;
116     public final Name java_lang_System;
117     public final Name __primitive__;
118     public final Name java_lang___primitive__;
119     public final Name java_lang_IdentityObject;
120 
121     // names of builtin classes
122     public final Name Array;
123     public final Name Bound;
124     public final Name Method;
125 
126     // package names
127     public final Name java;
128     public final Name java_lang;
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 JavaFlags;
149     public final Name LineNumberTable;
150     public final Name LocalVariableTable;
151     public final Name LocalVariableTypeTable;
152     public final Name MethodParameters;
153     public final Name Module;
154     public final Name ModuleResolution;
155     public final Name NestHost;
156     public final Name NestMembers;
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;

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         with = fromString("with");
267         yield = fromString("yield");
268 
269         // field and method names
270         _name = fromString("name");
271         addSuppressed = fromString("addSuppressed");
272         any = fromString("<any>");
273         append = fromString("append");
274         clinit = fromString("<clinit>");
275         clone = fromString("clone");
276         close = fromString("close");
277         deserializeLambda = fromString("$deserializeLambda$");
278         desiredAssertionStatus = fromString("desiredAssertionStatus");
279         equals = fromString("equals");
280         error = fromString("<error>");
281         finalize = fromString("finalize");
282         forRemoval = fromString("forRemoval");
283         reflective = fromString("reflective");
284         getClass = fromString("getClass");
285         hasNext = fromString("hasNext");
286         hashCode = fromString("hashCode");
287         init = fromString("<init>");
288         iterator = fromString("iterator");
289         length = fromString("length");
290         next = fromString("next");
291         newIdentity = fromString("newIdentity");
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         valueOf = fromString("valueOf");
299         values = fromString("values");
300         readResolve = fromString("readResolve");
301         readObject = fromString("readObject");
302         dollarThis = fromString("$this");
303 
304         // class names
305         java_io_Serializable = fromString("java.io.Serializable");
306         java_lang_Class = fromString("java.lang.Class");
307         java_lang_Cloneable = fromString("java.lang.Cloneable");
308         java_lang_Enum = fromString("java.lang.Enum");
309         java_lang_Object = fromString("java.lang.Object");
310         java_lang_System = fromString("java.lang.System");
311         __primitive__ = fromString("__primitive__");
312         java_lang___primitive__ = fromString("java.lang.__primitive__");
313         java_lang_IdentityObject = fromString("java.lang.IdentityObject");
314 
315         // names of builtin classes
316         Array = fromString("Array");
317         Bound = fromString("Bound");
318         Method = fromString("Method");
319 
320         // package names
321         java = fromString("java");
322         java_lang = fromString("java.lang");
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         JavaFlags = fromString("JavaFlags");
344         LocalVariableTable = fromString("LocalVariableTable");
345         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
346         MethodParameters = fromString("MethodParameters");
347         Module = fromString("Module");
348         ModuleResolution = fromString("ModuleResolution");
349         NestHost = fromString("NestHost");
350         NestMembers = fromString("NestMembers");
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");

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 >