KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > jimple > toolkits > pointer > representations > TypeConstants


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2003 Feng Qian
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20 package soot.jimple.toolkits.pointer.representations;
21
22 import soot.*;
23 import soot.options.*;
24 import soot.jimple.*;
25
26 public class TypeConstants {
27     public static TypeConstants v() { return G.v().soot_jimple_toolkits_pointer_representations_TypeConstants(); }
28   
29   public Type OBJECTCLASS;
30   public Type STRINGCLASS;
31   public Type CLASSLOADERCLASS;
32   public Type PROCESSCLASS;
33   public Type THREADCLASS;
34   public Type CLASSCLASS;
35   public Type LEASTCLASS;
36   public Type FIELDCLASS;
37   public Type METHODCLASS;
38   public Type CONSTRUCTORCLASS;
39   public Type FILESYSTEMCLASS;
40   public Type PRIVILEGEDACTIONEXCEPTION;
41
42     public TypeConstants( Singletons.Global g ) {
43         int jdkver =
44             new CGOptions(PhaseOptions.v().getPhaseOptions("cg")).jdkver();
45
46         OBJECTCLASS =
47         RefType.v("java.lang.Object");
48
49         STRINGCLASS =
50         RefType.v("java.lang.String");
51
52         CLASSLOADERCLASS =
53         AnySubType.v( RefType.v("java.lang.ClassLoader") );
54
55         PROCESSCLASS =
56         AnySubType.v( RefType.v("java.lang.Process") );
57
58         THREADCLASS =
59         AnySubType.v( RefType.v( "java.lang.Thread"));
60
61         CLASSCLASS =
62         RefType.v("java.lang.Class");
63
64         LEASTCLASS =
65         AnySubType.v( RefType.v( "java.lang.Object" ) );
66
67         FIELDCLASS =
68         RefType.v("java.lang.reflect.Field");
69
70         METHODCLASS =
71         RefType.v("java.lang.reflect.Method");
72
73         CONSTRUCTORCLASS =
74         RefType.v("java.lang.reflect.Constructor");
75
76         if(jdkver >= 2) {
77             FILESYSTEMCLASS =
78             AnySubType.v( RefType.v("java.io.FileSystem") );
79         }
80
81         if(jdkver >= 2) {
82             PRIVILEGEDACTIONEXCEPTION =
83             AnySubType.v( RefType.v("java.security.PrivilegedActionException") );
84         }
85     }
86 }
87
Popular Tags