Search in sources :

Example 6 with Visitor

use of org.apache.bcel.classfile.Visitor in project contribution by checkstyle.

the class VisitorSet method visitCode.

/**
 * @see org.apache.bcel.classfile.Visitor#visitCode
 */
public void visitCode(Code aCode) {
    for (Iterator iter = mVisitors.iterator(); iter.hasNext(); ) {
        IDeepVisitor visitor = (IDeepVisitor) iter.next();
        Visitor v = visitor.getClassFileVisitor();
        aCode.accept(v);
    }
    // perform a deep visit
    final byte[] code = aCode.getCode();
    final InstructionList list = new InstructionList(code);
    final Iterator it = list.iterator();
    for (Iterator iter = list.iterator(); iter.hasNext(); ) {
        InstructionHandle instruction = (InstructionHandle) iter.next();
        visitInstructionHandle(instruction);
    }
}
Also used : Visitor(org.apache.bcel.classfile.Visitor) EmptyVisitor(org.apache.bcel.classfile.EmptyVisitor) InstructionList(org.apache.bcel.generic.InstructionList) Iterator(java.util.Iterator) InstructionHandle(org.apache.bcel.generic.InstructionHandle)

Aggregations

Iterator (java.util.Iterator)6 EmptyVisitor (org.apache.bcel.classfile.EmptyVisitor)6 Visitor (org.apache.bcel.classfile.Visitor)6 InstructionHandle (org.apache.bcel.generic.InstructionHandle)1 InstructionList (org.apache.bcel.generic.InstructionList)1