KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ca > mcgill > sable > soot > launching > SootClasspath


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2003 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 ca.mcgill.sable.soot.launching;
21
22 import org.eclipse.core.runtime.*;
23 import org.eclipse.jdt.core.*;
24
25
26 /**
27  * Determines the soot-classpath for running Soot
28  */

29 public class SootClasspath {
30
31     private String JavaDoc jre_lib;
32     private String JavaDoc soot_lib;
33     private String JavaDoc jasmin_lib;
34     private String JavaDoc dot = ".";
35     private String JavaDoc separator = System.getProperty("path.separator");
36     
37     public SootClasspath() {
38     }
39     
40     public void initialize() {
41         // local location of jre lib
42
setJre_lib(JavaCore.getClasspathVariable("JRE_LIB").toOSString());
43         // external jars location - may need to change
44
//System.out.println(JavaCore.getClasspathVariable("SOOT_LIB").toString());
45
String JavaDoc external_jars_location = Platform.getLocation().removeLastSegments(2).toOSString();
46         // location of soot classes
47
setSoot_lib(external_jars_location+System.getProperty("file.separator")+"soot_dir"+System.getProperty("file.separator")+"classes");
48         // location of jasmin classes
49
setJasmin_lib(external_jars_location+System.getProperty("file.separator")+"jasminclasses-sable-1.2.jar");
50     }
51     
52     public String JavaDoc getSootClasspath() {
53         StringBuffer JavaDoc cp = new StringBuffer JavaDoc();
54         
55         return cp.toString();
56     }
57     
58     
59     /**
60      * Returns the dot.
61      * @return String
62      */

63     public String JavaDoc getDot() {
64         return dot;
65     }
66
67     /**
68      * Returns the jasmin_lib.
69      * @return String
70      */

71     public String JavaDoc getJasmin_lib() {
72         return jasmin_lib;
73     }
74
75     /**
76      * Returns the jre_lib.
77      * @return String
78      */

79     public String JavaDoc getJre_lib() {
80         return jre_lib;
81     }
82
83     /**
84      * Returns the separator.
85      * @return String
86      */

87     public String JavaDoc getSeparator() {
88         return separator;
89     }
90
91     /**
92      * Returns the soot_lib.
93      * @return String
94      */

95     public String JavaDoc getSoot_lib() {
96         return soot_lib;
97     }
98
99     /**
100      * Sets the dot.
101      * @param dot The dot to set
102      */

103     public void setDot(String JavaDoc dot) {
104         this.dot = dot;
105     }
106
107     /**
108      * Sets the jasmin_lib.
109      * @param jasmin_lib The jasmin_lib to set
110      */

111     public void setJasmin_lib(String JavaDoc jasmin_lib) {
112         this.jasmin_lib = jasmin_lib;
113     }
114
115     /**
116      * Sets the jre_lib.
117      * @param jre_lib The jre_lib to set
118      */

119     public void setJre_lib(String JavaDoc jre_lib) {
120         this.jre_lib = jre_lib;
121     }
122
123     /**
124      * Sets the separator.
125      * @param separator The separator to set
126      */

127     public void setSeparator(String JavaDoc separator) {
128         this.separator = separator;
129     }
130
131     /**
132      * Sets the soot_lib.
133      * @param soot_lib The soot_lib to set
134      */

135     public void setSoot_lib(String JavaDoc soot_lib) {
136         this.soot_lib = soot_lib;
137     }
138
139 }
140
Popular Tags