KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > julia > ant > J2MEConverter


1 /***
2  * Julia: France Telecom's implementation of the Fractal API
3  * Copyright (C) 2001-2002 France Telecom R&D
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: Eric.Bruneton@rd.francetelecom.com
20  *
21  * Author: Eric Bruneton
22  */

23
24 package org.objectweb.fractal.julia.ant;
25
26 import org.apache.tools.ant.BuildException;
27 import org.apache.tools.ant.taskdefs.MatchingTask;
28 import org.objectweb.asm.ClassReader;
29 import org.objectweb.asm.ClassVisitor;
30 import org.objectweb.asm.CodeVisitor;
31 import org.objectweb.asm.Attribute;
32 import org.objectweb.asm.ClassWriter;
33 import org.objectweb.asm.ClassAdapter;
34 import org.objectweb.asm.CodeAdapter;
35 import org.objectweb.asm.Constants;
36 import org.objectweb.asm.Label;
37
38 import java.io.File JavaDoc;
39 import java.io.FileInputStream JavaDoc;
40 import java.io.InputStream JavaDoc;
41 import java.io.OutputStream JavaDoc;
42 import java.io.FileOutputStream JavaDoc;
43 import java.util.HashMap JavaDoc;
44 import java.util.Map JavaDoc;
45 import java.util.Arrays JavaDoc;
46 import java.util.List JavaDoc;
47 import java.util.ArrayList JavaDoc;
48 import java.util.Enumeration JavaDoc;
49 import java.util.Set JavaDoc;
50 import java.util.HashSet JavaDoc;
51 import java.util.zip.ZipFile JavaDoc;
52 import java.util.zip.ZipEntry JavaDoc;
53
54 public class J2MEConverter extends MatchingTask {
55
56   private File JavaDoc src;
57
58   private File JavaDoc dst;
59
60   private File JavaDoc cldcJar;
61
62   private Set JavaDoc cldcAPI;
63
64   private int errors;
65
66   private final static String JavaDoc[] METHODS = new String JavaDoc[] {
67     "java/util/List,size()I",
68     "java/util/List,get(I)Ljava/lang/Object;",
69     "java/util/List,contains(Ljava/lang/Object;)Z",
70     "java/util/List,set(ILjava/lang/Object;)Ljava/lang/Object;",
71     "java/util/List,add(Ljava/lang/Object;)Z",
72     "java/util/List,add(ILjava/lang/Object;)V",
73     "java/util/List,remove(Ljava/lang/Object;)Z",
74     "java/util/List,remove(I)Ljava/lang/Object;",
75     "java/util/List,toArray()[Ljava/lang/Object;",
76     "java/util/List,toArray([Ljava/lang/Object;)[Ljava/lang/Object;",
77     "java/util/Set,size()I",
78     "java/util/Set,contains(Ljava/lang/Object;)Z",
79     "java/util/Set,add(Ljava/lang/Object;)Z",
80     "java/util/Set,toArray()[Ljava/lang/Object;",
81     "java/util/Set,toArray([Ljava/lang/Object;)[Ljava/lang/Object;",
82     "java/util/Map,size()I",
83     "java/util/Map,get(Ljava/lang/Object;)Ljava/lang/Object;",
84     "java/util/Map,put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
85     "java/util/Map,remove(Ljava/lang/Object;)Ljava/lang/Object;",
86     "java/util/Map,keySet()Ljava/util/Set;",
87     "java/util/ArrayList,<init>()V",
88     "java/util/HashSet,<init>()V",
89     "java/util/HashMap,<init>()V",
90   };
91
92   private final static Map JavaDoc INDEXES = new HashMap JavaDoc();
93
94   static {
95     for (int i = 0; i < METHODS.length; ++i) {
96       INDEXES.put(METHODS[i], new Integer JavaDoc(i));
97     }
98   }
99
100   public void setSrcdir (final File JavaDoc src) {
101     this.src = src;
102   }
103
104   public void setDestdir (final File JavaDoc dst) {
105     this.dst = dst;
106   }
107
108   public void setCldcjar (final File JavaDoc cldcJar) {
109     this.cldcJar = cldcJar;
110   }
111
112   /**
113    * Executes this task.
114    */

115
116   public void execute () {
117     if (src == null) {
118       throw new BuildException("srcdir must be specified");
119     }
120     if (dst == null) {
121       throw new BuildException("destdir must be specified");
122     }
123
124     try {
125       if (cldcJar != null) {
126         cldcAPI = new HashSet JavaDoc();
127         ZipFile JavaDoc zf = new ZipFile JavaDoc(cldcJar);
128         Enumeration JavaDoc e = zf.entries();
129         while (e.hasMoreElements()) {
130           ZipEntry JavaDoc ze = (ZipEntry JavaDoc)e.nextElement();
131           if (ze.getName().endsWith(".class")) {
132             new ClassReader(zf.getInputStream(ze)).accept(new ClassAnalyzer(), true);
133           }
134         }
135       }
136     } catch (Exception JavaDoc e) {
137       log(e.getMessage());
138     }
139
140     int total = 0;
141     String JavaDoc[] files = getDirectoryScanner(src).getIncludedFiles();
142     for (int i = 0; i < files.length; ++i) {
143       File JavaDoc srcFile = new File JavaDoc(src, files[i]);
144       File JavaDoc dstFile = new File JavaDoc(dst, files[i]);
145       if (dstFile.exists() && dstFile.lastModified() > srcFile.lastModified()) {
146         continue;
147       }
148
149       ClassReader cr;
150       try {
151         InputStream JavaDoc is = new FileInputStream JavaDoc(srcFile);
152         cr = new ClassReader(is);
153       } catch (Exception JavaDoc e) {
154         log(e.getMessage());
155         continue;
156       }
157
158       ClassWriter cw = new ClassWriter(false);
159       ClassConverter converter = new ClassConverter(cw);
160       cr.accept(converter, true);
161
162       try {
163         dstFile.getParentFile().mkdirs();
164         OutputStream JavaDoc os = new FileOutputStream JavaDoc(dstFile);
165         os.write(cw.toByteArray());
166         os.close();
167       } catch (Exception JavaDoc e) {
168         log(e.getMessage());
169         continue;
170       }
171       ++total;
172     }
173
174     if (errors > 0) {
175       throw new BuildException();
176     } else if (total > 0) {
177       if (total == 1) {
178         log("1 class transformed into " + dst);
179       } else {
180         log(total + " classes transformed into " + dst);
181       }
182     }
183   }
184
185   static String JavaDoc convertDescriptor (final String JavaDoc desc) {
186     if (desc.equals("java/util/ArrayList")) {
187       return "java/util/Vector";
188     } else if (desc.equals("java/util/HashSet")) {
189       return "java/util/Hashtable";
190     } else if (desc.equals("java/util/HashMap")) {
191       return "java/util/Hashtable";
192     }
193     boolean done;
194     String JavaDoc newDesc = desc;
195     do {
196       done = true;
197       int i = newDesc.indexOf("java/util/List");
198       if (i != -1) {
199         newDesc = newDesc.substring(0, i)
200           + "java/util/Vector"
201           + newDesc.substring(i + 14);
202         done = false;
203       }
204       i = newDesc.indexOf("java/util/Set");
205       if (i != -1) {
206         newDesc = newDesc.substring(0, i)
207           + "java/util/Hashtable"
208           + newDesc.substring(i + 13);
209         done = false;
210       }
211       i = newDesc.indexOf("java/util/Map");
212       if (i != -1) {
213         newDesc = newDesc.substring(0, i)
214           + "java/util/Hashtable"
215           + newDesc.substring(i + 13);
216         done = false;
217       }
218     } while (!done);
219     return newDesc;
220   }
221
222   class ClassAnalyzer implements ClassVisitor, Constants {
223
224     private String JavaDoc name;
225
226     public void visit (
227       final int version,
228       final int access,
229       final String JavaDoc name,
230       final String JavaDoc superName,
231       final String JavaDoc[] interfaces,
232       final String JavaDoc sourceFile)
233     {
234       this.name = name;
235     }
236
237     public void visitField (
238       int access,
239       String JavaDoc name,
240       String JavaDoc desc,
241       Object JavaDoc value,
242       Attribute attrs)
243     {
244       if ((access & (ACC_PUBLIC | ACC_PROTECTED)) != 0) {
245         cldcAPI.add(this.name+","+name);
246       }
247     }
248
249     public CodeVisitor visitMethod (
250       final int access,
251       final String JavaDoc name,
252       final String JavaDoc desc,
253       final String JavaDoc[] exceptions,
254       final Attribute attrs)
255     {
256       if ((access & (ACC_PUBLIC | ACC_PROTECTED)) != 0) {
257         cldcAPI.add(this.name+","+name+desc);
258       }
259       return null;
260     }
261
262     public void visitInnerClass (
263       final String JavaDoc name,
264       final String JavaDoc outerName,
265       final String JavaDoc innerName,
266       final int access)
267     {
268     }
269
270     public void visitAttribute (final Attribute attribute) {
271     }
272
273     public void visitEnd () {
274     }
275   }
276
277   class ClassConverter extends ClassAdapter implements Constants {
278
279     private String JavaDoc name;
280     private boolean hasVectorToArray;
281     private boolean hasHashtableToArray;
282
283     public ClassConverter (ClassVisitor cv) {
284       super(cv);
285     }
286
287     public void visit (
288       final int version,
289       final int access,
290       final String JavaDoc name,
291       final String JavaDoc superName,
292       final String JavaDoc[] interfaces,
293       final String JavaDoc sourceFile)
294     {
295       this.name = name;
296       List JavaDoc itfList = new ArrayList JavaDoc(Arrays.asList(interfaces));
297       itfList.remove("java/io/Serializable");
298       String JavaDoc[] itfs = (String JavaDoc[])itfList.toArray(new String JavaDoc[itfList.size()]);
299       cv.visit(version, access, name, superName, itfs, sourceFile);
300     }
301
302     public void visitField (
303       int access,
304       String JavaDoc name,
305       String JavaDoc desc,
306       Object JavaDoc value,
307       Attribute attrs)
308     {
309       cv.visitField(access, name, convertDescriptor(desc), value, attrs);
310     }
311
312     public CodeVisitor visitMethod (
313       final int access,
314       final String JavaDoc name,
315       final String JavaDoc desc,
316       final String JavaDoc[] exceptions,
317       final Attribute attrs)
318     {
319       if (name.equals("writeObject") && desc.equals("(Ljava/io/ObjectOutputStream;)V")) {
320         return null;
321       }
322       if (name.equals("readObject") && desc.equals("(Ljava/io/ObjectInputStream;)V")) {
323         return null;
324       }
325       if (name.equals("printStackTrace") && !desc.equals("()V")) {
326         return null;
327       }
328       if (name.equals("getInputStream")) {
329         CodeVisitor c = cv.visitMethod(access, name, desc, exceptions, attrs);
330         c.visitTypeInsn(NEW, "java/io/IOException");
331         c.visitInsn(DUP);
332         c.visitMethodInsn(INVOKESPECIAL, "java/io/IOException", "<init>", "()V");
333         c.visitInsn(ATHROW);
334         c.visitMaxs(2, 2);
335         return null;
336       }
337       if (name.equals("_forName")) {
338         CodeVisitor c = cv.visitMethod(access, name, desc, exceptions, attrs);
339         c.visitVarInsn(ALOAD, 1);
340         c.visitMethodInsn(INVOKESTATIC, "java/lang/Class", "forName", desc);
341         c.visitInsn(ARETURN);
342         c.visitMaxs(2, 2);
343         return null;
344       }
345       String JavaDoc newDesc = convertDescriptor(desc);
346       return new CodeConverter(
347         this, cv.visitMethod(access, name, newDesc, exceptions, attrs));
348     }
349
350     public void generateVectorToArrayMethod () {
351       if (hasVectorToArray) {
352         return;
353       } else {
354         hasVectorToArray = true;
355       }
356       CodeVisitor c = cv.visitMethod(ACC_STATIC, "toArray", "(Ljava/util/Vector;[Ljava/lang/Object;)[Ljava/lang/Object;", null, null);
357       c.visitInsn(ICONST_0);
358       c.visitVarInsn(ISTORE, 2);
359       Label l0 = new Label();
360       c.visitJumpInsn(GOTO, l0);
361       Label l1 = new Label();
362       c.visitLabel(l1);
363       c.visitVarInsn(ALOAD, 1);
364       c.visitVarInsn(ILOAD, 2);
365       c.visitVarInsn(ALOAD, 0);
366       c.visitVarInsn(ILOAD, 2);
367       c.visitMethodInsn(INVOKEVIRTUAL, "java/util/Vector", "elementAt", "(I)Ljava/lang/Object;");
368       c.visitInsn(AASTORE);
369       c.visitIincInsn(2, 1);
370       c.visitLabel(l0);
371       c.visitVarInsn(ILOAD, 2);
372       c.visitVarInsn(ALOAD, 1);
373       c.visitInsn(ARRAYLENGTH);
374       c.visitJumpInsn(IF_ICMPLT, l1);
375       c.visitVarInsn(ALOAD, 1);
376       c.visitInsn(ARETURN);
377       c.visitMaxs(4, 3);
378     }
379
380     public void generateHashtableToArrayMethod () {
381       if (hasHashtableToArray) {
382         return;
383       } else {
384         hasHashtableToArray = true;
385       }
386       CodeVisitor c = cv.visitMethod(ACC_STATIC, "toArray", "(Ljava/util/Hashtable;[Ljava/lang/Object;)[Ljava/lang/Object;", null, null);
387       c.visitInsn(ICONST_0);
388       c.visitVarInsn(ISTORE, 2);
389       c.visitVarInsn(ALOAD, 0);
390       c.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", "keys", "()Ljava/util/Enumeration;");
391       c.visitVarInsn(ASTORE, 3);
392       Label l0 = new Label();
393       c.visitJumpInsn(GOTO, l0);
394       Label l1 = new Label();
395       c.visitLabel(l1);
396       c.visitVarInsn(ALOAD, 1);
397       c.visitVarInsn(ILOAD, 2);
398       c.visitIincInsn(2, 1);
399       c.visitVarInsn(ALOAD, 3);
400       c.visitMethodInsn(INVOKEINTERFACE, "java/util/Enumeration", "nextElement", "()Ljava/lang/Object;");
401       c.visitInsn(AASTORE);
402       c.visitLabel(l0);
403       c.visitVarInsn(ALOAD, 3);
404       c.visitMethodInsn(INVOKEINTERFACE, "java/util/Enumeration", "hasMoreElements", "()Z");
405       c.visitJumpInsn(IFNE, l1);
406       c.visitVarInsn(ALOAD, 1);
407       c.visitInsn(ARETURN);
408       c.visitMaxs(3, 4);
409     }
410   }
411
412   class CodeConverter extends CodeAdapter implements Constants {
413
414     ClassConverter c;
415     String JavaDoc lastMethodCallInsn;
416     boolean mustNotUseResult;
417
418     public CodeConverter (ClassConverter c, CodeVisitor cv) {
419       super(cv);
420       this.c = c;
421     }
422
423     private void check (int opcode) {
424       if (mustNotUseResult && opcode != POP) {
425         log(c.name + ": must not use result of " + lastMethodCallInsn);
426         ++errors;
427       }
428       mustNotUseResult = false;
429     }
430
431     public void visitInsn (final int opcode) {
432       check(opcode);
433       cv.visitInsn(opcode);
434     }
435
436     public void visitIntInsn (final int opcode, final int operand) {
437       check(opcode);
438       cv.visitIntInsn(opcode, operand);
439     }
440
441     public void visitVarInsn (final int opcode, final int var) {
442       check(opcode);
443       cv.visitVarInsn(opcode, var);
444     }
445
446     public void visitTypeInsn (final int opcode, final String JavaDoc desc) {
447       check(opcode);
448       cv.visitTypeInsn(opcode, convertDescriptor(desc));
449     }
450
451     public void visitFieldInsn (
452       final int opcode,
453       final String JavaDoc owner,
454       final String JavaDoc name,
455       final String JavaDoc desc)
456     {
457       check(opcode);
458       if (cldcAPI != null && owner.startsWith("java")) {
459         String JavaDoc key = owner+","+name;
460         if (!cldcAPI.contains(key)) {
461           log(c.name + ": must not use " + key + "(not in CLDC API)");
462           ++errors;
463         }
464       }
465       cv.visitFieldInsn(opcode, owner, name, convertDescriptor(desc));
466     }
467
468     public void visitMethodInsn (
469       final int opcode,
470       final String JavaDoc owner,
471       final String JavaDoc name,
472       final String JavaDoc desc)
473     {
474       check(opcode);
475       String JavaDoc key = owner + "," + name + desc;
476       if (cldcAPI != null && owner.startsWith("java")) {
477         if (!cldcAPI.contains(key) && INDEXES.get(key) == null) {
478           log(c.name + ": must not use " + key + " (not in CLDC API)");
479           ++errors;
480         }
481       }
482       String JavaDoc newDesc = convertDescriptor(desc);
483       if (owner.startsWith("java/util")
484         && !owner.equals("java/util/Vector")
485         && !owner.equals("java/util/Hashtable")
486         && !owner.equals("java/util/Enumeration"))
487       {
488         Integer JavaDoc id = (Integer JavaDoc)INDEXES.get(key);
489         if (id == null) {
490           log(c.name + ": unauthorized method " + key);
491           ++errors;
492         }
493         lastMethodCallInsn = key;
494         switch (id.intValue()) {
495           case 0: // "java/util/List,size,()I"
496
cv.visitMethodInsn(
497               INVOKEVIRTUAL, "java/util/Vector", name, desc);
498             break;
499           case 1: // "java/util/List,get,(I)Ljava/lang/Object;"
500
cv.visitMethodInsn(
501               INVOKEVIRTUAL, "java/util/Vector", name, desc);
502             break;
503           case 2: // "java/util/List,contains,(Ljava/lang/Object;)Z"
504
cv.visitMethodInsn(
505               INVOKEVIRTUAL, "java/util/Vector", name, desc);
506             break;
507           case 3: // "java/util/List,set,(ILjava/lang/Object;)Ljava/lang/Object;"
508
mustNotUseResult = true;
509             cv.visitInsn(SWAP);
510             cv.visitMethodInsn(
511               INVOKEVIRTUAL, "java/util/Vector", "setElementAt", "(Ljava/lang/Object;I)V");
512             cv.visitInsn(ACONST_NULL);
513             break;
514           case 4: // "java/util/List,add,(Ljava/lang/Object;)Z"
515
mustNotUseResult = true;
516             cv.visitMethodInsn(
517               INVOKEVIRTUAL, "java/util/Vector", "addElement", "(Ljava/lang/Object;)V");
518             cv.visitInsn(ICONST_0);
519             break;
520           case 5: // "java/util/List,add,(ILjava/lang/Object;)V"
521
cv.visitInsn(SWAP);
522             cv.visitMethodInsn(
523               INVOKEVIRTUAL, "java/util/Vector", "insertElementAt", "(Ljava/lang/Object;I)V");
524             break;
525           case 6: // "java/util/List,remove,(Ljava/lang/Object;)Z"
526
cv.visitMethodInsn(
527               INVOKEVIRTUAL, "java/util/Vector", "removeElement", desc);
528             break;
529           case 7: // "java/util/List,remove,(I)Ljava/lang/Object;"
530
mustNotUseResult = true;
531             cv.visitMethodInsn(
532               INVOKEVIRTUAL, "java/util/Vector", "removeElementAt", "(I)V");
533             cv.visitInsn(ACONST_NULL);
534             break;
535           case 8: // "java/util/List,toArray,()[Ljava/lang/Object;"
536
cv.visitInsn(DUP);
537             cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Vector", "size", "()I");
538             cv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
539             c.generateVectorToArrayMethod();
540             cv.visitMethodInsn(INVOKESTATIC, c.name, name, "(Ljava/util/Vector;[Ljava/lang/Object;)[Ljava/lang/Object;");
541             break;
542           case 9: // "java/util/List,toArray,([Ljava/lang/Object;)[Ljava/lang/Object;"
543
c.generateVectorToArrayMethod();
544             cv.visitMethodInsn(INVOKESTATIC, c.name, name, "(Ljava/util/Vector;[Ljava/lang/Object;)[Ljava/lang/Object;");
545             break;
546           case 10: // "java/util/Set,size,()I"
547
cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc);
548             break;
549           case 11: // "java/util/Set,contains,(Ljava/lang/Object;)Z"
550
cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", "containsKey", desc);
551             break;
552           case 12: // "java/util/Set,add,(Ljava/lang/Object;)Z"
553
mustNotUseResult = true;
554             cv.visitInsn(DUP);
555             cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
556             cv.visitInsn(POP);
557             cv.visitInsn(ICONST_0);
558             break;
559           case 13: // "java/util/Set,toArray,()[Ljava/lang/Object;"
560
cv.visitInsn(DUP);
561             cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", "size", "()I");
562             cv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
563             c.generateHashtableToArrayMethod();
564             cv.visitMethodInsn(INVOKESTATIC, c.name, name, "(Ljava/util/Hashtable;[Ljava/lang/Object;)[Ljava/lang/Object;");
565             break;
566           case 14: // "java/util/Set,toArray,([Ljava/lang/Object;)[Ljava/lang/Object;"
567
c.generateHashtableToArrayMethod();
568             cv.visitMethodInsn(INVOKESTATIC, c.name, name, "(Ljava/util/Hashtable;[Ljava/lang/Object;)[Ljava/lang/Object;");
569             break;
570           case 15: // "java/util/Map,size,()I"
571
cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc);
572             break;
573           case 16: // "java/util/Map,get,(Ljava/lang/Object;)Ljava/lang/Object;"
574
cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc);
575             break;
576           case 17: // "java/util/Map,put,(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"
577
cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc);
578             break;
579           case 18: // "java/util/Map,remove,(Ljava/lang/Object;)Ljava/lang/Object;"
580
cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc);
581             break;
582           case 19: // "java/util/Map,keySet,()Ljava/util/Set;"
583
// nothing to do: the key set is the map itself (clone needed?)
584
break;
585           case 20: // "java/util/ArrayList,<init>()V"
586
cv.visitMethodInsn(opcode, "java/util/Vector", name, desc);
587             break;
588           case 21: // "java/util/HashSet,<init>()V"
589
cv.visitMethodInsn(opcode, "java/util/Hashtable", name, desc);
590             break;
591           case 22: // "java/util/HashMap,<init>()V"
592
cv.visitMethodInsn(opcode, "java/util/Hashtable", name, desc);
593             break;
594           default:
595             throw new RuntimeException JavaDoc("Internal error"); // should not happen
596
}
597       } else {
598         cv.visitMethodInsn(opcode, owner, name, newDesc);
599       }
600     }
601
602     public void visitJumpInsn (final int opcode, final Label label) {
603       check(opcode);
604       cv.visitJumpInsn(opcode, label);
605     }
606
607     public void visitLdcInsn (final Object JavaDoc cst) {
608       check(LDC);
609       cv.visitLdcInsn(cst);
610     }
611
612     public void visitIincInsn (final int var, final int increment) {
613       check(IINC);
614       cv.visitIincInsn(var, increment);
615     }
616
617     public void visitTableSwitchInsn (
618       final int min,
619       final int max,
620       final Label dflt,
621       final Label labels[])
622     {
623       check(TABLESWITCH);
624       cv.visitTableSwitchInsn(min, max, dflt, labels);
625     }
626
627     public void visitLookupSwitchInsn (
628       final Label dflt,
629       final int keys[],
630       final Label labels[])
631     {
632       check(LOOKUPSWITCH);
633       cv.visitLookupSwitchInsn(dflt, keys, labels);
634     }
635
636     public void visitMultiANewArrayInsn (final String JavaDoc desc, final int dims) {
637       check(MULTIANEWARRAY);
638       cv.visitMultiANewArrayInsn(desc, dims);
639     }
640   }
641 }
642
Popular Tags