KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > javaToJimple > AnonClassInitMethodSource


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2004 Jennifer Lhotak
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.javaToJimple;
21
22 import java.util.*;
23 import soot.*;
24
25 public class AnonClassInitMethodSource extends soot.javaToJimple.PolyglotMethodSource {
26
27     private boolean hasOuterRef;
28     public void hasOuterRef(boolean b){
29         hasOuterRef = b;
30     }
31     public boolean hasOuterRef(){
32         return hasOuterRef;
33     }
34     
35     private boolean hasQualifier;
36     public void hasQualifier(boolean b){
37         hasQualifier = b;
38     }
39     public boolean hasQualifier(){
40         return hasQualifier;
41     }
42     
43     
44     private boolean inStaticMethod;
45
46     public void inStaticMethod(boolean b){
47         inStaticMethod = b;
48     }
49     public boolean inStaticMethod(){
50         return inStaticMethod;
51     }
52     
53
54     private boolean isSubType = false;
55     public void isSubType(boolean b){
56         isSubType = b;
57     }
58     public boolean isSubType(){
59         return isSubType;
60     }
61     
62     private soot.Type superOuterType = null;
63     private soot.Type thisOuterType = null;
64
65     public void superOuterType(soot.Type t){
66         superOuterType = t;
67     }
68     public soot.Type superOuterType(){
69         return superOuterType;
70     }
71
72     public void thisOuterType(soot.Type t){
73         thisOuterType = t;
74     }
75     public soot.Type thisOuterType(){
76         return thisOuterType;
77     }
78
79     private polyglot.types.ClassType polyglotType;
80     public void polyglotType(polyglot.types.ClassType type){
81         polyglotType = type;
82     }
83     public polyglot.types.ClassType polyglotType() {
84         return polyglotType;
85     }
86     
87     private polyglot.types.ClassType anonType;
88     public void anonType(polyglot.types.ClassType type){
89         anonType = type;
90     }
91     public polyglot.types.ClassType anonType() {
92         return anonType;
93     }
94     
95     public soot.Body getBody(soot.SootMethod sootMethod, String JavaDoc phaseName){
96         AnonInitBodyBuilder aibb = new AnonInitBodyBuilder();
97         soot.jimple.JimpleBody body = aibb.createBody(sootMethod);
98         
99         PackManager.v().getPack("jj").apply(body);
100     
101         return body;
102     }
103     
104     private soot.Type outerClassType;
105
106     public soot.Type outerClassType(){
107         return outerClassType;
108     }
109     
110     public void outerClassType(soot.Type type){
111         outerClassType = type;
112     }
113 }
114
Popular Tags