1 /*
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
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
28 /**
29 * The mirror for a type in the target VM.
30 * This interface is the root of a type hierarchy encompassing primitive
31 * types and reference types.
32 * <P>
33 * A Type may be used to represent a run-time type:
34 * <BLOCKQUOTE>
35 * {@link Value}.type()
36 * </BLOCKQUOTE>
37 * or a compile-time type:
38 * <BLOCKQUOTE>
39 * {@link Field#type()} <BR>
40 * {@link Method#returnType()} <BR>
41 * {@link Method#argumentTypes()} <BR>
42 * {@link LocalVariable#type()} <BR>
43 * {@link ArrayType#componentType()}
44 * </BLOCKQUOTE>
45 * <P>
46 * The following table illustrates which subinterfaces of Type
47 * are used to mirror types in the target VM --
48 * <TABLE BORDER=1 SUMMARY="Maps each type declared in target to a mirrored
49 * instance of a subinterface of PrimitiveType or ReferenceType">
50 * <TR BGCOLOR="#EEEEFF">
51 * <TH id="primtype" colspan=3>Subinterfaces of {@link PrimitiveType}</TH>
52 * <TR BGCOLOR="#EEEEFF">
53 * <TH id="declared" align="left" colspan=2>Type declared in target as</TH>
54 * <TH id="mirrored" align="left">Is mirrored as an instance of</TH>
55 * <TR>
56 * <TD headers="primtype declared" colspan=2><CODE>boolean</CODE></TD>
57 * <TD headers="primtype mirrored"> {@link BooleanType}</TD>
58 * <TR>
59 * <TD headers="primtype declared" colspan=2><CODE>byte</CODE></TD>
60 * <TD headers="primtype mirrored">{@link ByteType}</TD>
61 * <TR>
62 * <TD headers="primtype declared" colspan=2><CODE>char</CODE></TD>
63 * <TD headers="primtype mirrored">{@link CharType}</TD>
64 * <TR>
65 * <TD headers="primtype declared" colspan=2><CODE>double</CODE></TD>
66 * <TD headers="primtype mirrored">{@link DoubleType}</TD>
67 * <TR>
68 * <TD headers="primtype declared" colspan=2><CODE>float</CODE></TD>
69 * <TD headers="primtype mirrored">{@link FloatType}</TD>
70 * <TR>
71 * <TD headers="primtype declared" colspan=2><CODE>int</CODE></TD>
72 * <TD headers="primtype mirrored">{@link IntegerType}</TD>
73 * <TR>
74 * <TD headers="primtype declared" colspan=2><CODE>long</CODE></TD>
75 * <TD headers="primtype mirrored">{@link LongType}</TD>
76 * <TR>
77 * <TD headers="primtype declared" colspan=2><CODE>short</CODE></TD>
78 * <TD headers="primtype mirrored">{@link ShortType}</TD>
79 * <TR>
80 * <TD headers="primtype declared" colspan=2><CODE>void</CODE></TD>
81 * <TD headers="primtype mirrored">{@link VoidType}</TD>
82 * <TR BGCOLOR="#EEEEFF">
83 * <TH id="reftype" colspan=3>Subinterfaces of {@link ReferenceType}</TH>
84 * <TR BGCOLOR="#EEEEFF">
85 * <TH id="declared2" align="left">Type declared in target as</TH>
86 * <TH id="example2" align="left">For example</TH>
87 * <TH id="mirrored2" align="left">Is mirrored as an instance of</TH>
88 * <TR>
89 * <TD headers="reftype declared2"><I>a class</I></TD>
90 * <TD headers="reftype example2"><CODE>Date</CODE></TD>
91 * <TD headers="reftype mirrored2">{@link ClassType}</TD>
92 * <TR>
93 * <TD headers="reftype declared2"><I>an interface</I></TD>
94 * <TD headers="reftype example2"><CODE>Runnable</CODE></TD>
95 * <TD headers="reftype mirrored2">{@link InterfaceType}</TD>
96 * <TR>
97 * <TD headers="reftype declared2"><I>an array</I></TD>
98 * <TD headers="reftype example2"> </TD>
99 * <TD headers="reftype mirrored2">{@link ArrayType}</TD>
100 * <TR>
101 * <TD headers="reftype declared2"><I>an array</I></TD>
102 * <TD headers="reftype example2"><CODE>int[]</CODE></TD>
103 * <TD headers="reftype mirrored2">{@link ArrayType} whose
104 * {@link ArrayType#componentType() componentType()} is
105 * {@link IntegerType}</TD>
106 * <TR>
107 * <TD headers="reftype declared2"><I>an array</I></TD>
|
1 /*
2 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
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
28 /**
29 * The mirror for a type in the target VM.
30 * This interface is the root of a type hierarchy encompassing primitive
31 * types and reference types.
32 * <P>
33 * A Type may be used to represent a run-time type:
34 * <BLOCKQUOTE>
35 * {@link Value}.type()
36 * </BLOCKQUOTE>
37 * or a compile-time type:
38 * <BLOCKQUOTE>
39 * {@link Field#type()} <BR>
40 * {@link Method#returnType()} <BR>
41 * {@link Method#argumentTypes()} <BR>
42 * {@link LocalVariable#type()} <BR>
43 * {@link ArrayType#componentType()}
44 * </BLOCKQUOTE>
45 * <P>
46 * The following table illustrates which subinterfaces of Type
47 * are used to mirror types in the target VM --
48 * <TABLE BORDER="1">
49 * <CAPTION style="display:none">Maps each type declared in target to a mirrored
50 * instance of a subinterface of PrimitiveType or ReferenceType"</CAPTION>
51 * <TR style="background-color:#EEEEFF">
52 * <TH id="primtype" colspan=3>Subinterfaces of {@link PrimitiveType}</TH>
53 * <TR style="background-color:#EEEEFF">
54 * <TH id="declared" style="text-align:left" colspan=2>Type declared in target as</TH>
55 * <TH id="mirrored" style="text-align:left">Is mirrored as an instance of</TH>
56 * <TR>
57 * <TD headers="primtype declared" colspan=2><CODE>boolean</CODE></TD>
58 * <TD headers="primtype mirrored"> {@link BooleanType}</TD>
59 * <TR>
60 * <TD headers="primtype declared" colspan=2><CODE>byte</CODE></TD>
61 * <TD headers="primtype mirrored">{@link ByteType}</TD>
62 * <TR>
63 * <TD headers="primtype declared" colspan=2><CODE>char</CODE></TD>
64 * <TD headers="primtype mirrored">{@link CharType}</TD>
65 * <TR>
66 * <TD headers="primtype declared" colspan=2><CODE>double</CODE></TD>
67 * <TD headers="primtype mirrored">{@link DoubleType}</TD>
68 * <TR>
69 * <TD headers="primtype declared" colspan=2><CODE>float</CODE></TD>
70 * <TD headers="primtype mirrored">{@link FloatType}</TD>
71 * <TR>
72 * <TD headers="primtype declared" colspan=2><CODE>int</CODE></TD>
73 * <TD headers="primtype mirrored">{@link IntegerType}</TD>
74 * <TR>
75 * <TD headers="primtype declared" colspan=2><CODE>long</CODE></TD>
76 * <TD headers="primtype mirrored">{@link LongType}</TD>
77 * <TR>
78 * <TD headers="primtype declared" colspan=2><CODE>short</CODE></TD>
79 * <TD headers="primtype mirrored">{@link ShortType}</TD>
80 * <TR>
81 * <TD headers="primtype declared" colspan=2><CODE>void</CODE></TD>
82 * <TD headers="primtype mirrored">{@link VoidType}</TD>
83 * <TR style="background-color:#EEEEFF">
84 * <TH id="reftype" colspan=3>Subinterfaces of {@link ReferenceType}</TH>
85 * <TR style="background-color:#EEEEFF">
86 * <TH id="declared2"style="text-align:left">Type declared in target as</TH>
87 * <TH id="example2" style="text-align:left">For example</TH>
88 * <TH id="mirrored2" style="text-align:left">Is mirrored as an instance of</TH>
89 * <TR>
90 * <TD headers="reftype declared2"><I>a class</I></TD>
91 * <TD headers="reftype example2"><CODE>Date</CODE></TD>
92 * <TD headers="reftype mirrored2">{@link ClassType}</TD>
93 * <TR>
94 * <TD headers="reftype declared2"><I>an interface</I></TD>
95 * <TD headers="reftype example2"><CODE>Runnable</CODE></TD>
96 * <TD headers="reftype mirrored2">{@link InterfaceType}</TD>
97 * <TR>
98 * <TD headers="reftype declared2"><I>an array</I></TD>
99 * <TD headers="reftype example2"> </TD>
100 * <TD headers="reftype mirrored2">{@link ArrayType}</TD>
101 * <TR>
102 * <TD headers="reftype declared2"><I>an array</I></TD>
103 * <TD headers="reftype example2"><CODE>int[]</CODE></TD>
104 * <TD headers="reftype mirrored2">{@link ArrayType} whose
105 * {@link ArrayType#componentType() componentType()} is
106 * {@link IntegerType}</TD>
107 * <TR>
108 * <TD headers="reftype declared2"><I>an array</I></TD>
|