21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.nashorn.internal.tools.nasgen;
27
28 import java.util.Collections;
29 import java.util.HashMap;
30 import java.util.LinkedList;
31 import java.util.List;
32 import java.util.Map;
33 import jdk.internal.org.objectweb.asm.Type;
34 import jdk.nashorn.internal.objects.annotations.Constructor;
35 import jdk.nashorn.internal.objects.annotations.Function;
36 import jdk.nashorn.internal.objects.annotations.Getter;
37 import jdk.nashorn.internal.objects.annotations.Property;
38 import jdk.nashorn.internal.objects.annotations.ScriptClass;
39 import jdk.nashorn.internal.objects.annotations.Setter;
40 import jdk.nashorn.internal.objects.annotations.SpecializedFunction;
41 import jdk.nashorn.internal.objects.annotations.Where;
42 import jdk.nashorn.internal.tools.nasgen.MemberInfo.Kind;
43
44 /**
45 * All annotation information from a class that is annotated with
46 * the annotation com.sun.oracle.objects.annotations.ScriptClass.
47 *
48 */
49 public final class ScriptClassInfo {
50 // descriptots for various annotations
51 static final String SCRIPT_CLASS_ANNO_DESC = Type.getDescriptor(ScriptClass.class);
52 static final String CONSTRUCTOR_ANNO_DESC = Type.getDescriptor(Constructor.class);
53 static final String FUNCTION_ANNO_DESC = Type.getDescriptor(Function.class);
54 static final String GETTER_ANNO_DESC = Type.getDescriptor(Getter.class);
55 static final String SETTER_ANNO_DESC = Type.getDescriptor(Setter.class);
56 static final String PROPERTY_ANNO_DESC = Type.getDescriptor(Property.class);
57 static final String WHERE_ENUM_DESC = Type.getDescriptor(Where.class);
58 static final String SPECIALIZED_FUNCTION = Type.getDescriptor(SpecializedFunction.class);
59 static final String LINK_LOGIC_DESC = "Ljdk/nashorn/internal/objects/annotations/SpecializedFunction$LinkLogic;";
60
61 static final Map<String, Kind> annotations = new HashMap<>();
62
63 static {
64 annotations.put(SCRIPT_CLASS_ANNO_DESC, Kind.SCRIPT_CLASS);
65 annotations.put(FUNCTION_ANNO_DESC, Kind.FUNCTION);
66 annotations.put(CONSTRUCTOR_ANNO_DESC, Kind.CONSTRUCTOR);
67 annotations.put(GETTER_ANNO_DESC, Kind.GETTER);
68 annotations.put(SETTER_ANNO_DESC, Kind.SETTER);
69 annotations.put(PROPERTY_ANNO_DESC, Kind.PROPERTY);
70 annotations.put(SPECIALIZED_FUNCTION, Kind.SPECIALIZED_FUNCTION);
71 }
72
73 // name of the script class
74 private String name;
75 // member info for script properties
76 private List<MemberInfo> members = Collections.emptyList();
77 // java class name that is annotated with @ScriptClass
78 private String javaName;
79
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.nashorn.internal.tools.nasgen;
27
28 import java.util.Collections;
29 import java.util.HashMap;
30 import java.util.LinkedList;
31 import java.util.List;
32 import java.util.Map;
33 import jdk.internal.org.objectweb.asm.Type;
34 import jdk.nashorn.internal.objects.annotations.Constructor;
35 import jdk.nashorn.internal.objects.annotations.Function;
36 import jdk.nashorn.internal.objects.annotations.Getter;
37 import jdk.nashorn.internal.objects.annotations.Property;
38 import jdk.nashorn.internal.objects.annotations.ScriptClass;
39 import jdk.nashorn.internal.objects.annotations.Setter;
40 import jdk.nashorn.internal.objects.annotations.SpecializedFunction;
41 import jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic;
42 import jdk.nashorn.internal.objects.annotations.Where;
43 import jdk.nashorn.internal.tools.nasgen.MemberInfo.Kind;
44
45 /**
46 * All annotation information from a class that is annotated with
47 * the annotation com.sun.oracle.objects.annotations.ScriptClass.
48 *
49 */
50 public final class ScriptClassInfo {
51 // descriptots for various annotations
52 static final String SCRIPT_CLASS_ANNO_DESC = Type.getDescriptor(ScriptClass.class);
53 static final String CONSTRUCTOR_ANNO_DESC = Type.getDescriptor(Constructor.class);
54 static final String FUNCTION_ANNO_DESC = Type.getDescriptor(Function.class);
55 static final String GETTER_ANNO_DESC = Type.getDescriptor(Getter.class);
56 static final String SETTER_ANNO_DESC = Type.getDescriptor(Setter.class);
57 static final String PROPERTY_ANNO_DESC = Type.getDescriptor(Property.class);
58 static final String WHERE_ENUM_DESC = Type.getDescriptor(Where.class);
59 static final String LINK_LOGIC_DESC = Type.getDescriptor(LinkLogic.class);
60 static final String SPECIALIZED_FUNCTION = Type.getDescriptor(SpecializedFunction.class);
61
62 static final Map<String, Kind> annotations = new HashMap<>();
63
64 static {
65 annotations.put(SCRIPT_CLASS_ANNO_DESC, Kind.SCRIPT_CLASS);
66 annotations.put(FUNCTION_ANNO_DESC, Kind.FUNCTION);
67 annotations.put(CONSTRUCTOR_ANNO_DESC, Kind.CONSTRUCTOR);
68 annotations.put(GETTER_ANNO_DESC, Kind.GETTER);
69 annotations.put(SETTER_ANNO_DESC, Kind.SETTER);
70 annotations.put(PROPERTY_ANNO_DESC, Kind.PROPERTY);
71 annotations.put(SPECIALIZED_FUNCTION, Kind.SPECIALIZED_FUNCTION);
72 }
73
74 // name of the script class
75 private String name;
76 // member info for script properties
77 private List<MemberInfo> members = Collections.emptyList();
78 // java class name that is annotated with @ScriptClass
79 private String javaName;
80
|