Class InstructionBuilderImpl
- java.lang.Object
- 
- org.apache.tapestry5.internal.plastic.Lockable
- 
- org.apache.tapestry5.internal.plastic.InstructionBuilderImpl
 
 
- 
- All Implemented Interfaces:
- org.apache.tapestry5.internal.plastic.asm.Opcodes,- InstructionBuilder
 
 public class InstructionBuilderImpl extends Lockable implements org.apache.tapestry5.internal.plastic.asm.Opcodes, InstructionBuilder 
- 
- 
Field SummaryFields Modifier and Type Field Description protected NameCachecacheprotected InstructionBuilderStatestateprotected org.apache.tapestry5.internal.plastic.asm.MethodVisitorv- 
Fields inherited from interface org.apache.tapestry5.internal.plastic.asm.OpcodesAALOAD, AASTORE, ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_MANDATED, ACC_MODULE, ACC_NATIVE, ACC_OPEN, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_RECORD, ACC_STATIC, ACC_STATIC_PHASE, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_TRANSITIVE, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASM4, ASM5, ASM6, ASM7, ASM8, ASM9_EXPERIMENTAL, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DOUBLE, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F_APPEND, F_CHOP, F_FULL, F_NEW, F_SAME, F_SAME1, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAT, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, H_GETFIELD, H_GETSTATIC, H_INVOKEINTERFACE, H_INVOKESPECIAL, H_INVOKESTATIC, H_INVOKEVIRTUAL, H_NEWINVOKESPECIAL, H_PUTFIELD, H_PUTSTATIC, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INTEGER, INVOKEDYNAMIC, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LONG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, NULL, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SOURCE_DEPRECATED, SOURCE_MASK, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH, TOP, UNINITIALIZED_THIS, V_PREVIEW, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V10, V11, V12, V13, V14, V15, V9
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description InstructionBuilderarrayLength()Expects the top object on the stack to be an array.InstructionBuilderboxPrimitive(String typeName)If the type name is a primitive type, adds code to box the type into the equivalent wrapper type, using static methods on the wrapper type.InstructionBuildercastOrUnbox(String typeName)Casts the object on top of the stack to the indicated type.InstructionBuildercheckcast(Class clazz)InstructionBuildercheckcast(String className)Adds a check that the object on top of the stack is assignable to the indicated class.InstructionBuildercompareSpecial(String typeName)Special comparison logic for primitive float, double and long.InstructionBuilderdoWhile(Condition condition, WhileCallback callback)Implements a simple loop based on a condition.InstructionBuilderdupe()Duplicates the top object on the stack.InstructionBuilderdupe(int depth)Duplicates the top object on the stack, placing the result at some depth.InstructionBuilderdupeWide()Duplicates a wide value (a primitive long or double).InstructionBuildergetField(String className, String fieldName, Class fieldType)Loads a field onto the stack.InstructionBuildergetField(String className, String fieldName, String typeName)Loads an instance field onto the stack.InstructionBuildergetField(PlasticField field)Loads an instance or static field onto the stack.InstructionBuildergetStaticField(String className, String fieldName, Class fieldType)Gets a static field; does not consume a value from the stack, but pushes the fields' value onto the stack.InstructionBuildergetStaticField(String className, String fieldName, String typeName)Gets a static field; does not consume a value from the stack, but pushes the fields' value onto the stack.InstructionBuilderincrement(LocalVariable variable)Increments a local integer variable.InstructionBuilderinvoke(Class clazz, Class returnType, String methodName, Class... argumentTypes)Automatically invokes an interface or virtual method.InstructionBuilderinvoke(Method method)Automatically invokes an interface or virtual method.InstructionBuilderinvokeConstructor(Class clazz, Class... argumentTypes)InstructionBuilderinvokeConstructor(String className, String... argumentTypes)Invokes a constructor on a class.InstructionBuilderinvokeInterface(String interfaceName, String returnType, String methodName, String... argumentTypes)Invokes a standard virtual method.InstructionBuilderinvokeSpecial(String containingClassName, MethodDescription description)Invokes an instance method of a base class, or a private method of a class, using the target object and parameters already on the stack.InstructionBuilderinvokeStatic(Class clazz, Class returnType, String methodName, Class... argumentTypes)Invokes a static method of a class.InstructionBuilderinvokeVirtual(String className, String returnType, String methodName, String... argumentTypes)Invokes a standard virtual method.InstructionBuilderinvokeVirtual(PlasticMethod method)InstructionBuilderiterateArray(InstructionBuilderCallback callback)Expects an array to be the top value on the stack.InstructionBuilderloadArgument(int index)Loads an argument onto the stack, using the opcode appropriate to the argument's type.InstructionBuilderloadArguments()Loads all arguments for the current method onto the stack; this is used when invoking a method that takes the exact same parameters (often, a super-class implementation).InstructionBuilderloadArrayElement()Loads a value from an array object.InstructionBuilderloadArrayElement(int index, String elementType)Loads a value from an array object, which must be the top element of the stack.InstructionBuilderloadConstant(Object constant)Loads a constant valueInstructionBuilderloadNull()Loads the null constant onto the stack.InstructionBuilderloadThis()Loads this onto the stack.InstructionBuilderloadTypeConstant(Class clazz)Loads a Java type (a Class instance) as a constant.InstructionBuilderloadTypeConstant(String typeName)Loads a Java type (a Class instance) as a constant.InstructionBuilderloadVariable(LocalVariable var)Loads a value from a local variable and pushes it onto the stack.InstructionBuildernewInstance(Class clazz)A convenience version ofInstructionBuilder.newInstance(String)used when the class is known at build time.InstructionBuildernewInstance(String className)Creates a new, uninitialized instance of the indicated class.InstructionBuilderpop()Discards the top value on the stack.InstructionBuilderpopWide()Pops a wide value (a primitive long or double).InstructionBuilderputField(String className, String fieldName, Class fieldType)InstructionBuilderputField(String className, String fieldName, String typeName)Expects the stack to contain the instance to update, and the value to store into the field.InstructionBuilderputStaticField(String className, String fieldName, Class fieldType)Sets a static field; the new field value should be on top of the stack.InstructionBuilderputStaticField(String className, String fieldName, String typeName)Sets a static field; the new field value should be on top of the stack.InstructionBuilderreturnDefaultValue()Returns the default value for the method, which may be null, or a specific primitive value.InstructionBuilderreturnResult()Returns the top value on the stack.InstructionBuilderstartSwitch(int min, int max, SwitchCallback callback)Starts a switch statement.InstructionBuilderstartTryCatch(TryCatchCallback callback)Defines the start of a block that can have exception handlers and finally blocks applied.InstructionBuilderstartVariable(String type, LocalVariableCallback callback)Starts a block where the given name is active.InstructionBuilderstoreVariable(LocalVariable var)Stores the value on top of the stack to a local variable (previously defined byInstructionBuilder.startVariable(String, LocalVariableCallback).InstructionBuilderswap()Swaps the top element of the stack with the next element down.InstructionBuilderthrowException()Throws the exception on the top of the stack.InstructionBuilderthrowException(Class<? extends Throwable> exceptionType, String message)InstructionBuilderthrowException(String className, String message)Throws an exception with a fixed message.InstructionBuilderunboxPrimitive(String typeName)Unboxes a wrapper type to a primitive type if typeName is a primitive type name (the value on the stack should be the corresponding wrapper type instance).InstructionBuilderwhen(Condition condition, InstructionBuilderCallback ifTrue)Simplified version ofInstructionBuilder.when(Condition, WhenCallback)that simply executes the callback code when the condition is true and does nothing if the condition is false (the more general case).InstructionBuilderwhen(Condition condition, WhenCallback callback)Executes conditional code based on aCondition.
 
- 
- 
- 
Field Detail- 
stateprotected final InstructionBuilderState state 
 - 
vprotected final org.apache.tapestry5.internal.plastic.asm.MethodVisitor v 
 
- 
 - 
Method Detail- 
returnDefaultValuepublic InstructionBuilder returnDefaultValue() Description copied from interface:InstructionBuilderReturns the default value for the method, which may be null, or a specific primitive value.- Specified by:
- returnDefaultValuein interface- InstructionBuilder
 
 - 
loadThispublic InstructionBuilder loadThis() Description copied from interface:InstructionBuilderLoads this onto the stack.- Specified by:
- loadThisin interface- InstructionBuilder
 
 - 
loadNullpublic InstructionBuilder loadNull() Description copied from interface:InstructionBuilderLoads the null constant onto the stack.- Specified by:
- loadNullin interface- InstructionBuilder
 
 - 
loadArgumentpublic InstructionBuilder loadArgument(int index) Description copied from interface:InstructionBuilderLoads an argument onto the stack, using the opcode appropriate to the argument's type. In addition this automatically adjusts for arguments of primitive type long or double (which take up two local variable indexes, rather than one as for all other types)- Specified by:
- loadArgumentin interface- InstructionBuilder
- Parameters:
- index- to argument (0 is the first argument, not this)
 
 - 
loadArgumentspublic InstructionBuilder loadArguments() Description copied from interface:InstructionBuilderLoads all arguments for the current method onto the stack; this is used when invoking a method that takes the exact same parameters (often, a super-class implementation). A call toInstructionBuilder.loadThis()(or some other way of identifying the target method) should precede this call.- Specified by:
- loadArgumentsin interface- InstructionBuilder
 
 - 
invokeSpecialpublic InstructionBuilder invokeSpecial(String containingClassName, MethodDescription description) Description copied from interface:InstructionBuilderInvokes an instance method of a base class, or a private method of a class, using the target object and parameters already on the stack. Leaves the result on the stack (unless its a void method).- Specified by:
- invokeSpecialin interface- InstructionBuilder
- Parameters:
- containingClassName- class name containing the method
- description- describes the method name, parameters and return type
 
 - 
invokeVirtualpublic InstructionBuilder invokeVirtual(PlasticMethod method) - Specified by:
- invokeVirtualin interface- InstructionBuilder
 
 - 
invokeVirtualpublic InstructionBuilder invokeVirtual(String className, String returnType, String methodName, String... argumentTypes) Description copied from interface:InstructionBuilderInvokes a standard virtual method.- Specified by:
- invokeVirtualin interface- InstructionBuilder
 
 - 
invokeInterfacepublic InstructionBuilder invokeInterface(String interfaceName, String returnType, String methodName, String... argumentTypes) Description copied from interface:InstructionBuilderInvokes a standard virtual method.- Specified by:
- invokeInterfacein interface- InstructionBuilder
 
 - 
invokeStaticpublic InstructionBuilder invokeStatic(Class clazz, Class returnType, String methodName, Class... argumentTypes) Description copied from interface:InstructionBuilderInvokes a static method of a class.- Specified by:
- invokeStaticin interface- InstructionBuilder
 
 - 
invokepublic InstructionBuilder invoke(Method method) Description copied from interface:InstructionBuilderAutomatically invokes an interface or virtual method. Remember to useInstructionBuilder.invokeConstructor(Class, Class...)for constructors andInstructionBuilder.invokeSpecial(String, MethodDescription)for private methods.- Specified by:
- invokein interface- InstructionBuilder
 
 - 
invokepublic InstructionBuilder invoke(Class clazz, Class returnType, String methodName, Class... argumentTypes) Description copied from interface:InstructionBuilderAutomatically invokes an interface or virtual method. Remember to useInstructionBuilder.invokeConstructor(Class, Class...)for constructors andInstructionBuilder.invokeSpecial(String, MethodDescription)for private methods.- Specified by:
- invokein interface- InstructionBuilder
 
 - 
returnResultpublic InstructionBuilder returnResult() Description copied from interface:InstructionBuilderReturns the top value on the stack. For void methods, no value should be on the stack and the method will simply return.- Specified by:
- returnResultin interface- InstructionBuilder
 
 - 
boxPrimitivepublic InstructionBuilder boxPrimitive(String typeName) Description copied from interface:InstructionBuilderIf the type name is a primitive type, adds code to box the type into the equivalent wrapper type, using static methods on the wrapper type. Does nothing if the type is not primitive, or type void.- Specified by:
- boxPrimitivein interface- InstructionBuilder
 
 - 
unboxPrimitivepublic InstructionBuilder unboxPrimitive(String typeName) Description copied from interface:InstructionBuilderUnboxes a wrapper type to a primitive type if typeName is a primitive type name (the value on the stack should be the corresponding wrapper type instance). Does nothing for non-primitive types.- Specified by:
- unboxPrimitivein interface- InstructionBuilder
- Parameters:
- typeName- possibly primitive type name
 
 - 
getFieldpublic InstructionBuilder getField(String className, String fieldName, String typeName) Description copied from interface:InstructionBuilderLoads an instance field onto the stack. The object containing the field should already be loaded onto the stack (usually, viaInstructionBuilder.loadThis()).- Specified by:
- getFieldin interface- InstructionBuilder
- Parameters:
- className- name of class containing the field
- fieldName- name of the field
- typeName- type of field
 
 - 
getStaticFieldpublic InstructionBuilder getStaticField(String className, String fieldName, String typeName) Description copied from interface:InstructionBuilderGets a static field; does not consume a value from the stack, but pushes the fields' value onto the stack.- Specified by:
- getStaticFieldin interface- InstructionBuilder
- Parameters:
- className- name of class containing the field
- fieldName- name of the field
- typeName- type of field
 
 - 
getStaticFieldpublic InstructionBuilder getStaticField(String className, String fieldName, Class fieldType) Description copied from interface:InstructionBuilderGets a static field; does not consume a value from the stack, but pushes the fields' value onto the stack.- Specified by:
- getStaticFieldin interface- InstructionBuilder
- Parameters:
- className- name of class containing the field
- fieldName- name of the field
- fieldType- type of field
 
 - 
putStaticFieldpublic InstructionBuilder putStaticField(String className, String fieldName, Class fieldType) Description copied from interface:InstructionBuilderSets a static field; the new field value should be on top of the stack.- Specified by:
- putStaticFieldin interface- InstructionBuilder
- Parameters:
- className- name of class containing the field
- fieldName- name of the field
- fieldType- type of field
 
 - 
putStaticFieldpublic InstructionBuilder putStaticField(String className, String fieldName, String typeName) Description copied from interface:InstructionBuilderSets a static field; the new field value should be on top of the stack.- Specified by:
- putStaticFieldin interface- InstructionBuilder
- Parameters:
- className- name of class containing the field
- fieldName- name of the field
- typeName- type of field
 
 - 
getFieldpublic InstructionBuilder getField(PlasticField field) Description copied from interface:InstructionBuilderLoads an instance or static field onto the stack. The plastic class instance containing the field should already be loaded onto the stack (usually, viaInstructionBuilder.loadThis()).- Specified by:
- getFieldin interface- InstructionBuilder
- Parameters:
- field- identifies name, type and container of field to load
 
 - 
putFieldpublic InstructionBuilder putField(String className, String fieldName, String typeName) Description copied from interface:InstructionBuilderExpects the stack to contain the instance to update, and the value to store into the field.- Specified by:
- putFieldin interface- InstructionBuilder
 
 - 
putFieldpublic InstructionBuilder putField(String className, String fieldName, Class fieldType) - Specified by:
- putFieldin interface- InstructionBuilder
 
 - 
getFieldpublic InstructionBuilder getField(String className, String fieldName, Class fieldType) Description copied from interface:InstructionBuilderLoads a field onto the stack. This version is used when the field type is known at build time, rather than discovered at runtime.- Specified by:
- getFieldin interface- InstructionBuilder
- Parameters:
- className- name of class containing the field
- fieldName- name of the field
- fieldType- type of field
 
 - 
loadArrayElementpublic InstructionBuilder loadArrayElement(int index, String elementType) Description copied from interface:InstructionBuilderLoads a value from an array object, which must be the top element of the stack.- Specified by:
- loadArrayElementin interface- InstructionBuilder
- Parameters:
- index- constant index into the array
- elementType- the type name of the elements of the array Note: currently only reference types (objects and arrays) are supported, not primitives
 
 - 
loadArrayElementpublic InstructionBuilder loadArrayElement() Description copied from interface:InstructionBuilderLoads a value from an array object. The stack should have the array at depth 1, and an array index on top. Only object arrays (not arrays of primitives) are supported.- Specified by:
- loadArrayElementin interface- InstructionBuilder
 
 - 
checkcastpublic InstructionBuilder checkcast(String className) Description copied from interface:InstructionBuilderAdds a check that the object on top of the stack is assignable to the indicated class.- Specified by:
- checkcastin interface- InstructionBuilder
- Parameters:
- className- class to cast to
 
 - 
checkcastpublic InstructionBuilder checkcast(Class clazz) - Specified by:
- checkcastin interface- InstructionBuilder
 
 - 
startTryCatchpublic InstructionBuilder startTryCatch(TryCatchCallback callback) Description copied from interface:InstructionBuilderDefines the start of a block that can have exception handlers and finally blocks applied. Continue using this InstructionBuilder to define code inside the block, then call methods on the InstructionBlock to define the end of the block and set up handlers.- Specified by:
- startTryCatchin interface- InstructionBuilder
- Parameters:
- callback- allows generation of try, catch, and finally clauses
 
 - 
newInstancepublic InstructionBuilder newInstance(String className) Description copied from interface:InstructionBuilderCreates a new, uninitialized instance of the indicated class. This should be followed by code to call the new instance's constructor.- Specified by:
- newInstancein interface- InstructionBuilder
- Parameters:
- className- of class to instantiate
 
 - 
newInstancepublic InstructionBuilder newInstance(Class clazz) Description copied from interface:InstructionBuilderA convenience version ofInstructionBuilder.newInstance(String)used when the class is known at build time.- Specified by:
- newInstancein interface- InstructionBuilder
- Parameters:
- clazz- to instantiate
 
 - 
invokeConstructorpublic InstructionBuilder invokeConstructor(String className, String... argumentTypes) Description copied from interface:InstructionBuilderInvokes a constructor on a class. The instance should already be on the stack, followed by the right number and type of parameters. Note that a constructor acts like a void method, so you will often follow the sequence: newInstance(), dupe(0), invokeConstructor() so that a reference to the instance is left on the stack.F- Specified by:
- invokeConstructorin interface- InstructionBuilder
- Parameters:
- className- the class containing the constructor
- argumentTypes- java type names for each argument of the constructor
 
 - 
invokeConstructorpublic InstructionBuilder invokeConstructor(Class clazz, Class... argumentTypes) - Specified by:
- invokeConstructorin interface- InstructionBuilder
 
 - 
dupepublic InstructionBuilder dupe(int depth) Description copied from interface:InstructionBuilderDuplicates the top object on the stack, placing the result at some depth.- Specified by:
- dupein interface- InstructionBuilder
- Parameters:
- depth- 0 (DUP), 1 (DUP_X1) or 2 (DUP_X2)
 
 - 
dupepublic InstructionBuilder dupe() Description copied from interface:InstructionBuilderDuplicates the top object on the stack. Commonly used withInstructionBuilder.when(Condition, WhenCallback).- Specified by:
- dupein interface- InstructionBuilder
- See Also:
- InstructionBuilder.dupe(int)
 
 - 
poppublic InstructionBuilder pop() Description copied from interface:InstructionBuilderDiscards the top value on the stack. Assumes the value is a single word value: an object reference, or a small primitive) and not a double or long.- Specified by:
- popin interface- InstructionBuilder
 
 - 
swappublic InstructionBuilder swap() Description copied from interface:InstructionBuilderSwaps the top element of the stack with the next element down. Note that this can cause problems if the top element on the stack is a long or double.- Specified by:
- swapin interface- InstructionBuilder
 
 - 
loadConstantpublic InstructionBuilder loadConstant(Object constant) Description copied from interface:InstructionBuilderLoads a constant value- Specified by:
- loadConstantin interface- InstructionBuilder
- Parameters:
- constant- Integer, Float, Double, Long, String or null
 
 - 
loadTypeConstantpublic InstructionBuilder loadTypeConstant(String typeName) Description copied from interface:InstructionBuilderLoads a Java type (a Class instance) as a constant. This assumes the type name is the name of class (or array) but not a primitive type.- Specified by:
- loadTypeConstantin interface- InstructionBuilder
- Parameters:
- typeName- Java class name
 
 - 
loadTypeConstantpublic InstructionBuilder loadTypeConstant(Class clazz) Description copied from interface:InstructionBuilderLoads a Java type (a Class instance) as a constant. This assumes the type name is the name of class (or array) but not a primitive type.- Specified by:
- loadTypeConstantin interface- InstructionBuilder
- Parameters:
- clazz- Java type to load as a constant
 
 - 
castOrUnboxpublic InstructionBuilder castOrUnbox(String typeName) Description copied from interface:InstructionBuilderCasts the object on top of the stack to the indicated type. For primitive types, casts to the wrapper type and invokes the appropriate unboxing static method call, leaving a primitive type value on the stack.- Specified by:
- castOrUnboxin interface- InstructionBuilder
- Parameters:
- typeName- to cast or unbox to
 
 - 
throwExceptionpublic InstructionBuilder throwException(String className, String message) Description copied from interface:InstructionBuilderThrows an exception with a fixed message. Assumes the exception class includes a constructor that takes a single string.- Specified by:
- throwExceptionin interface- InstructionBuilder
- Parameters:
- className- name of exception class to instantiate
- message- message (passed as first and only parameter to constructor)
 
 - 
throwExceptionpublic InstructionBuilder throwException(Class<? extends Throwable> exceptionType, String message) - Specified by:
- throwExceptionin interface- InstructionBuilder
 
 - 
throwExceptionpublic InstructionBuilder throwException() Description copied from interface:InstructionBuilderThrows the exception on the top of the stack.- Specified by:
- throwExceptionin interface- InstructionBuilder
 
 - 
startSwitchpublic InstructionBuilder startSwitch(int min, int max, SwitchCallback callback) Description copied from interface:InstructionBuilderStarts a switch statement.- Specified by:
- startSwitchin interface- InstructionBuilder
- Parameters:
- min- the minimum value to match against
- max- the maximum value to match against
 
 - 
startVariablepublic InstructionBuilder startVariable(String type, LocalVariableCallback callback) Description copied from interface:InstructionBuilderStarts a block where the given name is active.- Specified by:
- startVariablein interface- InstructionBuilder
- Parameters:
- type- type of local variable
- callback- generates code used when variable is in effect
 
 - 
storeVariablepublic InstructionBuilder storeVariable(LocalVariable var) Description copied from interface:InstructionBuilderStores the value on top of the stack to a local variable (previously defined byInstructionBuilder.startVariable(String, LocalVariableCallback).- Specified by:
- storeVariablein interface- InstructionBuilder
 
 - 
loadVariablepublic InstructionBuilder loadVariable(LocalVariable var) Description copied from interface:InstructionBuilderLoads a value from a local variable and pushes it onto the stack. The variable is defined byInstructionBuilder.startVariable(String, LocalVariableCallback).- Specified by:
- loadVariablein interface- InstructionBuilder
 
 - 
whenpublic InstructionBuilder when(Condition condition, InstructionBuilderCallback ifTrue) Description copied from interface:InstructionBuilderSimplified version ofInstructionBuilder.when(Condition, WhenCallback)that simply executes the callback code when the condition is true and does nothing if the condition is false (the more general case). The testing opcodes all pop the value off the stack, so this is usually preceded bydupe(0).- Specified by:
- whenin interface- InstructionBuilder
- Parameters:
- condition- to evaluate
- ifTrue- generates code for when condition is true
- Returns:
- this builder
 
 - 
whenpublic InstructionBuilder when(Condition condition, WhenCallback callback) Description copied from interface:InstructionBuilderExecutes conditional code based on aCondition. The testing opcodes all pop the value off the stack, so this is usually preceded bydupe(0).- Specified by:
- whenin interface- InstructionBuilder
- Parameters:
- condition- defines true and false cases
- callback- provides code for true and false blocks
- Returns:
- this builder
 
 - 
doWhilepublic InstructionBuilder doWhile(Condition condition, WhileCallback callback) Description copied from interface:InstructionBuilderImplements a simple loop based on a condition. First the WhileCallback.buildTest(InstructionBuilder) code is executed, then the condition is evaluated (which will consume at least the top value on the stack). When the condition is false, the loop is exited. When the condition is true, the code defined byWhileCallback.buildBody(InstructionBuilder)is executed, and then a GOTO back to the test code.- Specified by:
- doWhilein interface- InstructionBuilder
- Returns:
- this builder
 
 - 
incrementpublic InstructionBuilder increment(LocalVariable variable) Description copied from interface:InstructionBuilderIncrements a local integer variable.- Specified by:
- incrementin interface- InstructionBuilder
- Returns:
- this builder
 
 - 
arrayLengthpublic InstructionBuilder arrayLength() Description copied from interface:InstructionBuilderExpects the top object on the stack to be an array. Replaces it with the length of that array.- Specified by:
- arrayLengthin interface- InstructionBuilder
 
 - 
iterateArraypublic InstructionBuilder iterateArray(InstructionBuilderCallback callback) Description copied from interface:InstructionBuilderExpects an array to be the top value on the stack. Iterates the array. The callback generates code that will have each successive value from the array as the top value on the stack. Creates a variable to store the loop index.- Specified by:
- iterateArrayin interface- InstructionBuilder
- Parameters:
- callback- to invoke. The element will be the top value on the stack. The callback is responsible for removing it from the stack.
- Returns:
- this builder
 
 - 
dupeWidepublic InstructionBuilder dupeWide() Description copied from interface:InstructionBuilderDuplicates a wide value (a primitive long or double).- Specified by:
- dupeWidein interface- InstructionBuilder
 
 - 
popWidepublic InstructionBuilder popWide() Description copied from interface:InstructionBuilderPops a wide value (a primitive long or double).- Specified by:
- popWidein interface- InstructionBuilder
 
 - 
compareSpecialpublic InstructionBuilder compareSpecial(String typeName) Description copied from interface:InstructionBuilderSpecial comparison logic for primitive float, double and long. Expect two matching wide values on the stack. Reduces the two wide values to a single int value: -1, 0, or 1 depending on whether the deeper value is less than, equal to, or greater than the top value on the stack.- Specified by:
- compareSpecialin interface- InstructionBuilder
 
 
- 
 
-