src/share/classes/com/sun/tools/javap/ClassWriter.java

changeset 300
ed989c347b3c
parent 283
cd0630109de5
child 348
743f17b55b44
equal deleted inserted replaced
299:22872b24d38c 300:ed989c347b3c
91 91
92 void setLastModified(long lastModified) { 92 void setLastModified(long lastModified) {
93 this.lastModified = lastModified; 93 this.lastModified = lastModified;
94 } 94 }
95 95
96 ClassFile getClassFile() { 96 protected ClassFile getClassFile() {
97 return classFile; 97 return classFile;
98 } 98 }
99 99
100 Method getMethod() { 100 protected void setClassFile(ClassFile cf) {
101 return method;
102 }
103
104 public void write(ClassFile cf) {
105 classFile = cf; 101 classFile = cf;
106 constant_pool = classFile.constant_pool; 102 constant_pool = classFile.constant_pool;
103 }
104
105 protected Method getMethod() {
106 return method;
107 }
108
109 protected void setMethod(Method m) {
110 method = m;
111 }
112
113 public void write(ClassFile cf) {
114 setClassFile(cf);
107 115
108 if ((options.sysInfo || options.verbose) && !options.compat) { 116 if ((options.sysInfo || options.verbose) && !options.compat) {
109 if (uri != null) { 117 if (uri != null) {
110 if (uri.getScheme().equals("file")) 118 if (uri.getScheme().equals("file"))
111 println("Classfile " + uri.getPath()); 119 println("Classfile " + uri.getPath());
195 writeMethods(); 203 writeMethods();
196 println("}"); 204 println("}");
197 println(); 205 println();
198 } 206 }
199 207
200 void writeFields() { 208 protected void writeFields() {
201 for (Field f: classFile.fields) { 209 for (Field f: classFile.fields) {
202 writeField(f); 210 writeField(f);
203 } 211 }
204 } 212 }
205 213
206 void writeField(Field f) { 214 protected void writeField(Field f) {
207 if (!options.checkAccess(f.access_flags)) 215 if (!options.checkAccess(f.access_flags))
208 return; 216 return;
209 217
210 if (!(options.showLineAndLocalVariableTables 218 if (!(options.showLineAndLocalVariableTables
211 || options.showDisassembled 219 || options.showDisassembled
257 265
258 if (options.showDisassembled || options.showLineAndLocalVariableTables) 266 if (options.showDisassembled || options.showLineAndLocalVariableTables)
259 println(); 267 println();
260 } 268 }
261 269
262 void writeMethods() { 270 protected void writeMethods() {
263 for (Method m: classFile.methods) 271 for (Method m: classFile.methods)
264 writeMethod(m); 272 writeMethod(m);
265 } 273 }
266 274
267 void writeMethod(Method m) { 275 protected void writeMethod(Method m) {
268 if (!options.checkAccess(m.access_flags)) 276 if (!options.checkAccess(m.access_flags))
269 return; 277 return;
270 278
271 method = m; 279 method = m;
272 280

mercurial