Java Doc for GeneratorAdapter.java in  » Net » Terracotta » com » tc » asm » commons » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Terracotta » com.tc.asm.commons 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.tc.asm.commons.LocalVariablesSorter
   com.tc.asm.commons.GeneratorAdapter

All known Subclasses:   com.tc.asm.commons.AdviceAdapter,
GeneratorAdapter
public class GeneratorAdapter extends LocalVariablesSorter (Code)
A com.tc.asm.MethodAdapter with convenient methods to generate code. For example, using this adapter, the class below
 public class Example {
 public static void main(String[] args) {
 System.out.println("Hello world!");
 }
 }
 
can be generated as follows:
 ClassWriter cw = new ClassWriter(true);
 cw.visit(V1_1, ACC_PUBLIC, "Example", null, "java/lang/Object", null);
 Method m = Method.getMethod("void <init> ()");
 GeneratorAdapter mg = new GeneratorAdapter(ACC_PUBLIC, m, null, null, cw);
 mg.loadThis();
 mg.invokeConstructor(Type.getType(Object.class), m);
 mg.returnValue();
 mg.endMethod();
 m = Method.getMethod("void main (String[])");
 mg = new GeneratorAdapter(ACC_PUBLIC + ACC_STATIC, m, null, null, cw);
 mg.getStatic(Type.getType(System.class), "out", Type.getType(PrintStream.class));
 mg.push("Hello world!");
 mg.invokeVirtual(Type.getType(PrintStream.class), Method.getMethod("void println (String)"));
 mg.returnValue();
 mg.endMethod();
 cw.visitEnd();
 

author:
   Juozas Baliuka
author:
   Chris Nokleberg
author:
   Eric Bruneton


Field Summary
final public static  intADD
     Constant for the GeneratorAdapter.math math method.
final public static  intAND
     Constant for the GeneratorAdapter.math math method.
final public static  intDIV
     Constant for the GeneratorAdapter.math math method.
final public static  intEQ
     Constant for the GeneratorAdapter.ifCmp ifCmp method.
final public static  intGE
     Constant for the GeneratorAdapter.ifCmp ifCmp method.
final public static  intGT
     Constant for the GeneratorAdapter.ifCmp ifCmp method.
final public static  intLE
     Constant for the GeneratorAdapter.ifCmp ifCmp method.
final public static  intLT
     Constant for the GeneratorAdapter.ifCmp ifCmp method.
final public static  intMUL
     Constant for the GeneratorAdapter.math math method.
final public static  intNE
     Constant for the GeneratorAdapter.ifCmp ifCmp method.
final public static  intNEG
     Constant for the GeneratorAdapter.math math method.
final public static  intOR
     Constant for the GeneratorAdapter.math math method.
final public static  intREM
     Constant for the GeneratorAdapter.math math method.
final public static  intSHL
     Constant for the GeneratorAdapter.math math method.
final public static  intSHR
     Constant for the GeneratorAdapter.math math method.
final public static  intSUB
     Constant for the GeneratorAdapter.math math method.
final public static  intUSHR
     Constant for the GeneratorAdapter.math math method.
final public static  intXOR
     Constant for the GeneratorAdapter.math math method.

Constructor Summary
public  GeneratorAdapter(MethodVisitor mv, int access, String name, String desc)
     Creates a new GeneratorAdapter .
public  GeneratorAdapter(int access, Method method, MethodVisitor mv)
     Creates a new GeneratorAdapter .
public  GeneratorAdapter(int access, Method method, String signature, Type[] exceptions, ClassVisitor cv)
     Creates a new GeneratorAdapter .

Method Summary
public  voidarrayLength()
     Generates the instruction to compute the length of an array.
public  voidarrayLoad(Type type)
     Generates the instruction to load an element from an array.
public  voidarrayStore(Type type)
     Generates the instruction to store an element in an array.
public  voidbox(Type type)
     Generates the instructions to box the top stack value.
public  voidcast(Type from, Type to)
     Generates the instructions to cast a numerical value from one type to another.
public  voidcatchException(Label start, Label end, Type exception)
     Marks the start of an exception handler.
public  voidcheckCast(Type type)
     Generates the instruction to check that the top stack value is of the given type.
public  voiddup()
     Generates a DUP instruction.
public  voiddup2()
     Generates a DUP2 instruction.
public  voiddup2X1()
     Generates a DUP2_X1 instruction.
public  voiddup2X2()
     Generates a DUP2_X2 instruction.
public  voiddupX1()
     Generates a DUP_X1 instruction.
public  voiddupX2()
     Generates a DUP_X2 instruction.
public  voidendMethod()
     Marks the end of the visited method.
public  voidgetField(Type owner, String name, Type type)
     Generates the instruction to push the value of a non static field on the stack.
public  TypegetLocalType(int local)
     Returns the type of the given local variable.
Parameters:
  local - a local variable identifier, as returned byLocalVariablesSorter.newLocal(Type) newLocal().
public  voidgetStatic(Type owner, String name, Type type)
     Generates the instruction to push the value of a static field on the stack.
public  voidgoTo(Label label)
     Generates the instruction to jump to the given label.
public  voidifCmp(Type type, int mode, Label label)
     Generates the instructions to jump to a label based on the comparison of the top two stack values.
Parameters:
  type - the type of the top two stack values.
Parameters:
  mode - how these values must be compared.
public  voidifICmp(int mode, Label label)
     Generates the instructions to jump to a label based on the comparison of the top two integer stack values.
Parameters:
  mode - how these values must be compared.
public  voidifNonNull(Label label)
     Generates the instruction to jump to the given label if the top stack value is not null.
public  voidifNull(Label label)
     Generates the instruction to jump to the given label if the top stack value is null.
public  voidifZCmp(int mode, Label label)
     Generates the instructions to jump to a label based on the comparison of the top integer stack value with zero.
Parameters:
  mode - how these values must be compared.
public  voidiinc(int local, int amount)
     Generates the instruction to increment the given local variable.
public  voidinstanceOf(Type type)
     Generates the instruction to test if the top stack value is of the given type.
public  voidinvokeConstructor(Type type, Method method)
     Generates the instruction to invoke a constructor.
public  voidinvokeInterface(Type owner, Method method)
     Generates the instruction to invoke an interface method.
public  voidinvokeStatic(Type owner, Method method)
     Generates the instruction to invoke a static method.
public  voidinvokeVirtual(Type owner, Method method)
     Generates the instruction to invoke a normal method.
public  voidloadArg(int arg)
     Generates the instruction to load the given method argument on the stack.
public  voidloadArgArray()
     Generates the instructions to load all the method arguments on the stack, as a single object array.
public  voidloadArgs(int arg, int count)
     Generates the instructions to load the given method arguments on the stack.
public  voidloadArgs()
     Generates the instructions to load all the method arguments on the stack.
public  voidloadLocal(int local)
     Generates the instruction to load the given local variable on the stack.
public  voidloadLocal(int local, Type type)
     Generates the instruction to load the given local variable on the stack.
public  voidloadThis()
     Generates the instruction to load 'this' on the stack.
public  voidmark(Label label)
     Marks the current code position with the given label.
public  Labelmark()
     Marks the current code position with a new label.
public  voidmath(int op, Type type)
     Generates the instruction to do the specified mathematical or logical operation.
Parameters:
  op - a mathematical or logical operation.
public  voidmonitorEnter()
     Generates the instruction to get the monitor of the top stack value.
public  voidmonitorExit()
     Generates the instruction to release the monitor of the top stack value.
public  voidnewArray(Type type)
     Generates the instruction to create a new array.
public  voidnewInstance(Type type)
     Generates the instruction to create a new object.
public  LabelnewLabel()
     Creates a new Label .
public  voidnot()
     Generates the instructions to compute the bitwise negation of the top stack value.
public  voidpop()
     Generates a POP instruction.
public  voidpop2()
     Generates a POP2 instruction.
public  voidpush(boolean value)
     Generates the instruction to push the given value on the stack.
public  voidpush(int value)
     Generates the instruction to push the given value on the stack.
public  voidpush(long value)
     Generates the instruction to push the given value on the stack.
public  voidpush(float value)
     Generates the instruction to push the given value on the stack.
public  voidpush(double value)
     Generates the instruction to push the given value on the stack.
public  voidpush(String value)
     Generates the instruction to push the given value on the stack.
Parameters:
  value - the value to be pushed on the stack.
public  voidpush(Type value)
     Generates the instruction to push the given value on the stack.
public  voidputField(Type owner, String name, Type type)
     Generates the instruction to store the top stack value in a non static field.
public  voidputStatic(Type owner, String name, Type type)
     Generates the instruction to store the top stack value in a static field.
public  voidret(int local)
     Generates a RET instruction.
public  voidreturnValue()
     Generates the instruction to return the top stack value to the caller.
protected  voidsetLocalType(int local, Type type)
    
public  voidstoreArg(int arg)
     Generates the instruction to store the top stack value in the given method argument.
public  voidstoreLocal(int local)
     Generates the instruction to store the top stack value in the given local variable.
public  voidstoreLocal(int local, Type type)
     Generates the instruction to store the top stack value in the given local variable.
public  voidswap()
     Generates a SWAP instruction.
public  voidswap(Type prev, Type type)
     Generates the instructions to swap the top two stack values.
public  voidtableSwitch(int[] keys, TableSwitchGenerator generator)
     Generates the instructions for a switch statement.
public  voidtableSwitch(int[] keys, TableSwitchGenerator generator, boolean useTable)
     Generates the instructions for a switch statement.
public  voidthrowException()
     Generates the instruction to throw an exception.
public  voidthrowException(Type type, String msg)
     Generates the instructions to create and throw an exception.
public  voidunbox(Type type)
     Generates the instructions to unbox the top stack value.

Field Detail
ADD
final public static int ADD(Code)
Constant for the GeneratorAdapter.math math method.



AND
final public static int AND(Code)
Constant for the GeneratorAdapter.math math method.



DIV
final public static int DIV(Code)
Constant for the GeneratorAdapter.math math method.



EQ
final public static int EQ(Code)
Constant for the GeneratorAdapter.ifCmp ifCmp method.



GE
final public static int GE(Code)
Constant for the GeneratorAdapter.ifCmp ifCmp method.



GT
final public static int GT(Code)
Constant for the GeneratorAdapter.ifCmp ifCmp method.



LE
final public static int LE(Code)
Constant for the GeneratorAdapter.ifCmp ifCmp method.



LT
final public static int LT(Code)
Constant for the GeneratorAdapter.ifCmp ifCmp method.



MUL
final public static int MUL(Code)
Constant for the GeneratorAdapter.math math method.



NE
final public static int NE(Code)
Constant for the GeneratorAdapter.ifCmp ifCmp method.



NEG
final public static int NEG(Code)
Constant for the GeneratorAdapter.math math method.



OR
final public static int OR(Code)
Constant for the GeneratorAdapter.math math method.



REM
final public static int REM(Code)
Constant for the GeneratorAdapter.math math method.



SHL
final public static int SHL(Code)
Constant for the GeneratorAdapter.math math method.



SHR
final public static int SHR(Code)
Constant for the GeneratorAdapter.math math method.



SUB
final public static int SUB(Code)
Constant for the GeneratorAdapter.math math method.



USHR
final public static int USHR(Code)
Constant for the GeneratorAdapter.math math method.



XOR
final public static int XOR(Code)
Constant for the GeneratorAdapter.math math method.




Constructor Detail
GeneratorAdapter
public GeneratorAdapter(MethodVisitor mv, int access, String name, String desc)(Code)
Creates a new GeneratorAdapter .
Parameters:
  mv - the method visitor to which this adapter delegates calls.
Parameters:
  access - the method's access flags (see Opcodes).
Parameters:
  name - the method's name.
Parameters:
  desc - the method's descriptor (see Type Type).



GeneratorAdapter
public GeneratorAdapter(int access, Method method, MethodVisitor mv)(Code)
Creates a new GeneratorAdapter .
Parameters:
  access - access flags of the adapted method.
Parameters:
  method - the adapted method.
Parameters:
  mv - the method visitor to which this adapter delegates calls.



GeneratorAdapter
public GeneratorAdapter(int access, Method method, String signature, Type[] exceptions, ClassVisitor cv)(Code)
Creates a new GeneratorAdapter .
Parameters:
  access - access flags of the adapted method.
Parameters:
  method - the adapted method.
Parameters:
  signature - the signature of the adapted method (may benull).
Parameters:
  exceptions - the exceptions thrown by the adapted method (may benull).
Parameters:
  cv - the class visitor to which this adapter delegates calls.




Method Detail
arrayLength
public void arrayLength()(Code)
Generates the instruction to compute the length of an array.



arrayLoad
public void arrayLoad(Type type)(Code)
Generates the instruction to load an element from an array.
Parameters:
  type - the type of the array element to be loaded.



arrayStore
public void arrayStore(Type type)(Code)
Generates the instruction to store an element in an array.
Parameters:
  type - the type of the array element to be stored.



box
public void box(Type type)(Code)
Generates the instructions to box the top stack value. This value is replaced by its boxed equivalent on top of the stack.
Parameters:
  type - the type of the top stack value.



cast
public void cast(Type from, Type to)(Code)
Generates the instructions to cast a numerical value from one type to another.
Parameters:
  from - the type of the top stack value
Parameters:
  to - the type into which this value must be cast.



catchException
public void catchException(Label start, Label end, Type exception)(Code)
Marks the start of an exception handler.
Parameters:
  start - beginning of the exception handler's scope (inclusive).
Parameters:
  end - end of the exception handler's scope (exclusive).
Parameters:
  exception - internal name of the type of exceptions handled by thehandler.



checkCast
public void checkCast(Type type)(Code)
Generates the instruction to check that the top stack value is of the given type.
Parameters:
  type - a class or interface type.



dup
public void dup()(Code)
Generates a DUP instruction.



dup2
public void dup2()(Code)
Generates a DUP2 instruction.



dup2X1
public void dup2X1()(Code)
Generates a DUP2_X1 instruction.



dup2X2
public void dup2X2()(Code)
Generates a DUP2_X2 instruction.



dupX1
public void dupX1()(Code)
Generates a DUP_X1 instruction.



dupX2
public void dupX2()(Code)
Generates a DUP_X2 instruction.



endMethod
public void endMethod()(Code)
Marks the end of the visited method.



getField
public void getField(Type owner, String name, Type type)(Code)
Generates the instruction to push the value of a non static field on the stack.
Parameters:
  owner - the class in which the field is defined.
Parameters:
  name - the name of the field.
Parameters:
  type - the type of the field.



getLocalType
public Type getLocalType(int local)(Code)
Returns the type of the given local variable.
Parameters:
  local - a local variable identifier, as returned byLocalVariablesSorter.newLocal(Type) newLocal(). the type of the given local variable.



getStatic
public void getStatic(Type owner, String name, Type type)(Code)
Generates the instruction to push the value of a static field on the stack.
Parameters:
  owner - the class in which the field is defined.
Parameters:
  name - the name of the field.
Parameters:
  type - the type of the field.



goTo
public void goTo(Label label)(Code)
Generates the instruction to jump to the given label.
Parameters:
  label - where to jump if the condition is true.



ifCmp
public void ifCmp(Type type, int mode, Label label)(Code)
Generates the instructions to jump to a label based on the comparison of the top two stack values.
Parameters:
  type - the type of the top two stack values.
Parameters:
  mode - how these values must be compared. One of EQ, NE, LT, GE, GT,LE.
Parameters:
  label - where to jump if the comparison result is true.



ifICmp
public void ifICmp(int mode, Label label)(Code)
Generates the instructions to jump to a label based on the comparison of the top two integer stack values.
Parameters:
  mode - how these values must be compared. One of EQ, NE, LT, GE, GT,LE.
Parameters:
  label - where to jump if the comparison result is true.



ifNonNull
public void ifNonNull(Label label)(Code)
Generates the instruction to jump to the given label if the top stack value is not null.
Parameters:
  label - where to jump if the condition is true.



ifNull
public void ifNull(Label label)(Code)
Generates the instruction to jump to the given label if the top stack value is null.
Parameters:
  label - where to jump if the condition is true.



ifZCmp
public void ifZCmp(int mode, Label label)(Code)
Generates the instructions to jump to a label based on the comparison of the top integer stack value with zero.
Parameters:
  mode - how these values must be compared. One of EQ, NE, LT, GE, GT,LE.
Parameters:
  label - where to jump if the comparison result is true.



iinc
public void iinc(int local, int amount)(Code)
Generates the instruction to increment the given local variable.
Parameters:
  local - the local variable to be incremented.
Parameters:
  amount - the amount by which the local variable must be incremented.



instanceOf
public void instanceOf(Type type)(Code)
Generates the instruction to test if the top stack value is of the given type.
Parameters:
  type - a class or interface type.



invokeConstructor
public void invokeConstructor(Type type, Method method)(Code)
Generates the instruction to invoke a constructor.
Parameters:
  type - the class in which the constructor is defined.
Parameters:
  method - the constructor to be invoked.



invokeInterface
public void invokeInterface(Type owner, Method method)(Code)
Generates the instruction to invoke an interface method.
Parameters:
  owner - the class in which the method is defined.
Parameters:
  method - the method to be invoked.



invokeStatic
public void invokeStatic(Type owner, Method method)(Code)
Generates the instruction to invoke a static method.
Parameters:
  owner - the class in which the method is defined.
Parameters:
  method - the method to be invoked.



invokeVirtual
public void invokeVirtual(Type owner, Method method)(Code)
Generates the instruction to invoke a normal method.
Parameters:
  owner - the class in which the method is defined.
Parameters:
  method - the method to be invoked.



loadArg
public void loadArg(int arg)(Code)
Generates the instruction to load the given method argument on the stack.
Parameters:
  arg - the index of a method argument.



loadArgArray
public void loadArgArray()(Code)
Generates the instructions to load all the method arguments on the stack, as a single object array.



loadArgs
public void loadArgs(int arg, int count)(Code)
Generates the instructions to load the given method arguments on the stack.
Parameters:
  arg - the index of the first method argument to be loaded.
Parameters:
  count - the number of method arguments to be loaded.



loadArgs
public void loadArgs()(Code)
Generates the instructions to load all the method arguments on the stack.



loadLocal
public void loadLocal(int local)(Code)
Generates the instruction to load the given local variable on the stack.
Parameters:
  local - a local variable identifier, as returned byLocalVariablesSorter.newLocal(Type) newLocal().



loadLocal
public void loadLocal(int local, Type type)(Code)
Generates the instruction to load the given local variable on the stack.
Parameters:
  local - a local variable identifier, as returned byLocalVariablesSorter.newLocal(Type) newLocal().
Parameters:
  type - the type of this local variable.



loadThis
public void loadThis()(Code)
Generates the instruction to load 'this' on the stack.



mark
public void mark(Label label)(Code)
Marks the current code position with the given label.
Parameters:
  label - a label.



mark
public Label mark()(Code)
Marks the current code position with a new label. the label that was created to mark the current code position.



math
public void math(int op, Type type)(Code)
Generates the instruction to do the specified mathematical or logical operation.
Parameters:
  op - a mathematical or logical operation. Must be one of ADD, SUB,MUL, DIV, REM, NEG, SHL, SHR, USHR, AND, OR, XOR.
Parameters:
  type - the type of the operand(s) for this operation.



monitorEnter
public void monitorEnter()(Code)
Generates the instruction to get the monitor of the top stack value.



monitorExit
public void monitorExit()(Code)
Generates the instruction to release the monitor of the top stack value.



newArray
public void newArray(Type type)(Code)
Generates the instruction to create a new array.
Parameters:
  type - the type of the array elements.



newInstance
public void newInstance(Type type)(Code)
Generates the instruction to create a new object.
Parameters:
  type - the class of the object to be created.



newLabel
public Label newLabel()(Code)
Creates a new Label . a new Label.



not
public void not()(Code)
Generates the instructions to compute the bitwise negation of the top stack value.



pop
public void pop()(Code)
Generates a POP instruction.



pop2
public void pop2()(Code)
Generates a POP2 instruction.



push
public void push(boolean value)(Code)
Generates the instruction to push the given value on the stack.
Parameters:
  value - the value to be pushed on the stack.



push
public void push(int value)(Code)
Generates the instruction to push the given value on the stack.
Parameters:
  value - the value to be pushed on the stack.



push
public void push(long value)(Code)
Generates the instruction to push the given value on the stack.
Parameters:
  value - the value to be pushed on the stack.



push
public void push(float value)(Code)
Generates the instruction to push the given value on the stack.
Parameters:
  value - the value to be pushed on the stack.



push
public void push(double value)(Code)
Generates the instruction to push the given value on the stack.
Parameters:
  value - the value to be pushed on the stack.



push
public void push(String value)(Code)
Generates the instruction to push the given value on the stack.
Parameters:
  value - the value to be pushed on the stack. May be null.



push
public void push(Type value)(Code)
Generates the instruction to push the given value on the stack.
Parameters:
  value - the value to be pushed on the stack.



putField
public void putField(Type owner, String name, Type type)(Code)
Generates the instruction to store the top stack value in a non static field.
Parameters:
  owner - the class in which the field is defined.
Parameters:
  name - the name of the field.
Parameters:
  type - the type of the field.



putStatic
public void putStatic(Type owner, String name, Type type)(Code)
Generates the instruction to store the top stack value in a static field.
Parameters:
  owner - the class in which the field is defined.
Parameters:
  name - the name of the field.
Parameters:
  type - the type of the field.



ret
public void ret(int local)(Code)
Generates a RET instruction.
Parameters:
  local - a local variable identifier, as returned byLocalVariablesSorter.newLocal(Type) newLocal().



returnValue
public void returnValue()(Code)
Generates the instruction to return the top stack value to the caller.



setLocalType
protected void setLocalType(int local, Type type)(Code)



storeArg
public void storeArg(int arg)(Code)
Generates the instruction to store the top stack value in the given method argument.
Parameters:
  arg - the index of a method argument.



storeLocal
public void storeLocal(int local)(Code)
Generates the instruction to store the top stack value in the given local variable.
Parameters:
  local - a local variable identifier, as returned byLocalVariablesSorter.newLocal(Type) newLocal().



storeLocal
public void storeLocal(int local, Type type)(Code)
Generates the instruction to store the top stack value in the given local variable.
Parameters:
  local - a local variable identifier, as returned byLocalVariablesSorter.newLocal(Type) newLocal().
Parameters:
  type - the type of this local variable.



swap
public void swap()(Code)
Generates a SWAP instruction.



swap
public void swap(Type prev, Type type)(Code)
Generates the instructions to swap the top two stack values.
Parameters:
  prev - type of the top - 1 stack value.
Parameters:
  type - type of the top stack value.



tableSwitch
public void tableSwitch(int[] keys, TableSwitchGenerator generator)(Code)
Generates the instructions for a switch statement.
Parameters:
  keys - the switch case keys.
Parameters:
  generator - a generator to generate the code for the switch cases.



tableSwitch
public void tableSwitch(int[] keys, TableSwitchGenerator generator, boolean useTable)(Code)
Generates the instructions for a switch statement.
Parameters:
  keys - the switch case keys.
Parameters:
  generator - a generator to generate the code for the switch cases.
Parameters:
  useTable - true to use a TABLESWITCH instruction, orfalse to use a LOOKUPSWITCH instruction.



throwException
public void throwException()(Code)
Generates the instruction to throw an exception.



throwException
public void throwException(Type type, String msg)(Code)
Generates the instructions to create and throw an exception. The exception class must have a constructor with a single String argument.
Parameters:
  type - the class of the exception to be thrown.
Parameters:
  msg - the detailed message of the exception.



unbox
public void unbox(Type type)(Code)
Generates the instructions to unbox the top stack value. This value is replaced by its unboxed equivalent on top of the stack.
Parameters:
  type - the type of the top stack value.



Fields inherited from com.tc.asm.commons.LocalVariablesSorter
final protected int firstLocal(Code)(Java Doc)
protected int nextLocal(Code)(Java Doc)

Methods inherited from com.tc.asm.commons.LocalVariablesSorter
public int newLocal(Type type)(Code)(Java Doc)
protected void setLocalType(int local, Type type)(Code)(Java Doc)
public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack)(Code)(Java Doc)
public void visitIincInsn(int var, int increment)(Code)(Java Doc)
public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index)(Code)(Java Doc)
public void visitMaxs(int maxStack, int maxLocals)(Code)(Java Doc)
public void visitVarInsn(int opcode, int var)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.