< 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;

 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;
161     public final Name Synthetic;
162     public final Name Value;
163     public final Name Varargs;
164     public final Name PermittedSubclasses;
165 
166     // members of java.lang.annotation.ElementType
167     public final Name ANNOTATION_TYPE;
168     public final Name CONSTRUCTOR;

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");

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");
342         Value = fromString("Value");
343         Varargs = fromString("Varargs");
344         PermittedSubclasses = fromString("PermittedSubclasses");
345 
346         // members of java.lang.annotation.ElementType
347         ANNOTATION_TYPE = fromString("ANNOTATION_TYPE");
348         CONSTRUCTOR = fromString("CONSTRUCTOR");

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;

 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 primitive;
104     public final Name identity;
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 __value__;
120     public final Name java_lang___value__;
121 
122     // names of builtin classes
123     public final Name Array;
124     public final Name Bound;
125     public final Name Method;
126 
127     // package names
128     public final Name java;
129     public final Name java_lang;
130 
131     // module names
132     public final Name java_base;
133     public final Name jdk_unsupported;
134 
135     // attribute names
136     public final Name Annotation;
137     public final Name AnnotationDefault;
138     public final Name BootstrapMethods;
139     public final Name Bridge;
140     public final Name CharacterRangeTable;
141     public final Name Code;
142     public final Name CompilationID;
143     public final Name ConstantValue;
144     public final Name Deprecated;
145     public final Name EnclosingMethod;
146     public final Name Enum;
147     public final Name Exceptions;
148     public final Name InnerClasses;
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 Preload;
158     public final Name Record;
159     public final Name RuntimeInvisibleAnnotations;
160     public final Name RuntimeInvisibleParameterAnnotations;
161     public final Name RuntimeInvisibleTypeAnnotations;
162     public final Name RuntimeVisibleAnnotations;
163     public final Name RuntimeVisibleParameterAnnotations;
164     public final Name RuntimeVisibleTypeAnnotations;
165     public final Name Signature;
166     public final Name SourceFile;
167     public final Name SourceID;
168     public final Name StackMap;
169     public final Name StackMapTable;
170     public final Name Synthetic;
171     public final Name Value;
172     public final Name Varargs;
173     public final Name PermittedSubclasses;
174 
175     // members of java.lang.annotation.ElementType
176     public final Name ANNOTATION_TYPE;
177     public final Name CONSTRUCTOR;

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

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         dollarThis = fromString("$this");
304 
305         // class names
306         java_io_Serializable = fromString("java.io.Serializable");
307         java_lang_Class = fromString("java.lang.Class");
308         java_lang_Cloneable = fromString("java.lang.Cloneable");
309         java_lang_Enum = fromString("java.lang.Enum");
310         java_lang_Object = fromString("java.lang.Object");
311         java_lang_System = fromString("java.lang.System");
312         __primitive__ = fromString("__primitive__");
313         java_lang___primitive__ = fromString("java.lang.__primitive__");
314         __value__ = fromString("__value__");
315         java_lang___value__ = fromString("java.lang.__value__");
316 
317         // names of builtin classes
318         Array = fromString("Array");
319         Bound = fromString("Bound");
320         Method = fromString("Method");
321 
322         // package names
323         java = fromString("java");
324         java_lang = fromString("java.lang");
325 
326         // module names
327         java_base = fromString("java.base");
328         jdk_unsupported = fromString("jdk.unsupported");
329 
330         // attribute names
331         Annotation = fromString("Annotation");
332         AnnotationDefault = fromString("AnnotationDefault");
333         BootstrapMethods = fromString("BootstrapMethods");
334         Bridge = fromString("Bridge");
335         CharacterRangeTable = fromString("CharacterRangeTable");
336         Code = fromString("Code");
337         CompilationID = fromString("CompilationID");
338         ConstantValue = fromString("ConstantValue");
339         Deprecated = fromString("Deprecated");
340         EnclosingMethod = fromString("EnclosingMethod");
341         Enum = fromString("Enum");
342         Exceptions = fromString("Exceptions");
343         InnerClasses = fromString("InnerClasses");
344         LineNumberTable = fromString("LineNumberTable");
345         LocalVariableTable = fromString("LocalVariableTable");
346         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
347         MethodParameters = fromString("MethodParameters");
348         Module = fromString("Module");
349         ModuleResolution = fromString("ModuleResolution");
350         NestHost = fromString("NestHost");
351         NestMembers = fromString("NestMembers");
352         Preload = fromString("Preload");
353         Record = fromString("Record");
354         RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
355         RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
356         RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
357         RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations");
358         RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
359         RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations");
360         Signature = fromString("Signature");
361         SourceFile = fromString("SourceFile");
362         SourceID = fromString("SourceID");
363         StackMap = fromString("StackMap");
364         StackMapTable = fromString("StackMapTable");
365         Synthetic = fromString("Synthetic");
366         Value = fromString("Value");
367         Varargs = fromString("Varargs");
368         PermittedSubclasses = fromString("PermittedSubclasses");
369 
370         // members of java.lang.annotation.ElementType
371         ANNOTATION_TYPE = fromString("ANNOTATION_TYPE");
372         CONSTRUCTOR = fromString("CONSTRUCTOR");

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