Package net.sf.cglib.core

## Class LocalVariablesSorter

- java.lang.Object
- - org.objectweb.asm.MethodVisitor
  - - net.sf.cglib.core.LocalVariablesSorter

Direct Known Subclasses:
  `CodeEmitter`

    public class LocalVariablesSorter
    extends org.objectweb.asm.MethodVisitor

A `MethodVisitor` that renumbers local variables in their order of appearance. This adapter allows one to easily add new local variables to a method.

Author:
  Chris Nokleberg, Eric Bruneton

### Field Summary

Fields
`protected int` `firstLocal`

### Fields inherited from class org.objectweb.asm.MethodVisitor

`api, mv`

### Constructor Summary

Constructors
`LocalVariablesSorter​(int access, java.lang.String desc, org.objectweb.asm.MethodVisitor mv)`
`LocalVariablesSorter​(LocalVariablesSorter lvs)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected int` `newLocal​(int size)`
`void` `visitIincInsn​(int var, int increment)`
`void` `visitLocalVariable​(java.lang.String name, java.lang.String desc, java.lang.String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index)`
`void` `visitMaxs​(int maxStack, int maxLocals)`
`void` `visitVarInsn​(int opcode, int var)`

### Methods inherited from class org.objectweb.asm.MethodVisitor

`visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFieldInsn, visitFrame, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### firstLocal

    protected final int firstLocal

### Constructor Detail

#### LocalVariablesSorter

    public LocalVariablesSorter​(int access,
                                java.lang.String desc,
                                org.objectweb.asm.MethodVisitor mv)

#### LocalVariablesSorter

    public LocalVariablesSorter​(LocalVariablesSorter lvs)

### Method Detail

#### visitVarInsn

    public void visitVarInsn​(int opcode,
                             int var)

Overrides:
  `visitVarInsn` in class `org.objectweb.asm.MethodVisitor`

#### visitIincInsn

    public void visitIincInsn​(int var,
                              int increment)

Overrides:
  `visitIincInsn` in class `org.objectweb.asm.MethodVisitor`

#### visitMaxs

    public void visitMaxs​(int maxStack,
                          int maxLocals)

Overrides:
  `visitMaxs` in class `org.objectweb.asm.MethodVisitor`

#### visitLocalVariable

    public void visitLocalVariable​(java.lang.String name,
                                   java.lang.String desc,
                                   java.lang.String signature,
                                   org.objectweb.asm.Label start,
                                   org.objectweb.asm.Label end,
                                   int index)

Overrides:
  `visitLocalVariable` in class `org.objectweb.asm.MethodVisitor`

#### newLocal

    protected int newLocal​(int size)