org.apache.bcel.util

Class BCELFactory

Implemented Interfaces:
Visitor

(package private) class BCELFactory
extends EmptyVisitor

Factory creates il.append() statements, and sets instruction targets. A helper class for BCELifier.
Version:
$Id: BCELFactory.java 410087 2006-05-29 12:12:19Z tcurdt $
Author:
M. Dahm
See Also:
BCELifier

Field Summary

private ConstantPoolGen
_cp
private MethodGen
_mg
private PrintWriter
_out
private Map
branch_map
private List
branches

Constructor Summary

BCELFactory(MethodGen mg, PrintWriter out)

Method Summary

private void
createConstant(Object value)
void
start()
private void
updateBranchTargets()
private void
updateExceptionHandlers()
void
visitAllocationInstruction(AllocationInstruction i)
void
visitArrayInstruction(ArrayInstruction i)
void
visitBranchInstruction(BranchInstruction bi)
void
visitCHECKCAST(CHECKCAST i)
void
visitConstantPushInstruction(ConstantPushInstruction i)
void
visitFieldInstruction(FieldInstruction i)
void
visitINSTANCEOF(INSTANCEOF i)
private boolean
visitInstruction(Instruction i)
void
visitInvokeInstruction(InvokeInstruction i)
void
visitLDC(LDC i)
void
visitLDC2_W(LDC2_W i)
void
visitLocalVariableInstruction(LocalVariableInstruction i)
void
visitRET(RET i)
void
visitReturnInstruction(ReturnInstruction i)

Methods inherited from class org.apache.bcel.generic.EmptyVisitor

visitAALOAD, visitAASTORE, visitACONST_NULL, visitALOAD, visitANEWARRAY, visitARETURN, visitARRAYLENGTH, visitASTORE, visitATHROW, visitAllocationInstruction, visitArithmeticInstruction, visitArrayInstruction, visitBALOAD, visitBASTORE, visitBIPUSH, visitBREAKPOINT, visitBranchInstruction, visitCALOAD, visitCASTORE, visitCHECKCAST, visitCPInstruction, visitConstantPushInstruction, visitConversionInstruction, visitD2F, visitD2I, visitD2L, visitDADD, visitDALOAD, visitDASTORE, visitDCMPG, visitDCMPL, visitDCONST, visitDDIV, visitDLOAD, visitDMUL, visitDNEG, visitDREM, visitDRETURN, visitDSTORE, visitDSUB, visitDUP, visitDUP2, visitDUP2_X1, visitDUP2_X2, visitDUP_X1, visitDUP_X2, visitExceptionThrower, visitF2D, visitF2I, visitF2L, visitFADD, visitFALOAD, visitFASTORE, visitFCMPG, visitFCMPL, visitFCONST, visitFDIV, visitFLOAD, visitFMUL, visitFNEG, visitFREM, visitFRETURN, visitFSTORE, visitFSUB, visitFieldInstruction, visitFieldOrMethod, visitGETFIELD, visitGETSTATIC, visitGOTO, visitGOTO_W, visitGotoInstruction, visitI2B, visitI2C, visitI2D, visitI2F, visitI2L, visitI2S, visitIADD, visitIALOAD, visitIAND, visitIASTORE, visitICONST, visitIDIV, visitIFEQ, visitIFGE, visitIFGT, visitIFLE, visitIFLT, visitIFNE, visitIFNONNULL, visitIFNULL, visitIF_ACMPEQ, visitIF_ACMPNE, visitIF_ICMPEQ, visitIF_ICMPGE, visitIF_ICMPGT, visitIF_ICMPLE, visitIF_ICMPLT, visitIF_ICMPNE, visitIINC, visitILOAD, visitIMPDEP1, visitIMPDEP2, visitIMUL, visitINEG, visitINSTANCEOF, visitINVOKEINTERFACE, visitINVOKESPECIAL, visitINVOKESTATIC, visitINVOKEVIRTUAL, visitIOR, visitIREM, visitIRETURN, visitISHL, visitISHR, visitISTORE, visitISUB, visitIUSHR, visitIXOR, visitIfInstruction, visitInvokeInstruction, visitJSR, visitJSR_W, visitJsrInstruction, visitL2D, visitL2F, visitL2I, visitLADD, visitLALOAD, visitLAND, visitLASTORE, visitLCMP, visitLCONST, visitLDC, visitLDC2_W, visitLDIV, visitLLOAD, visitLMUL, visitLNEG, visitLOOKUPSWITCH, visitLOR, visitLREM, visitLRETURN, visitLSHL, visitLSHR, visitLSTORE, visitLSUB, visitLUSHR, visitLXOR, visitLoadClass, visitLoadInstruction, visitLocalVariableInstruction, visitMONITORENTER, visitMONITOREXIT, visitMULTIANEWARRAY, visitNEW, visitNEWARRAY, visitNOP, visitPOP, visitPOP2, visitPUTFIELD, visitPUTSTATIC, visitPopInstruction, visitPushInstruction, visitRET, visitRETURN, visitReturnInstruction, visitSALOAD, visitSASTORE, visitSIPUSH, visitSWAP, visitSelect, visitStackConsumer, visitStackInstruction, visitStackProducer, visitStoreInstruction, visitTABLESWITCH, visitTypedInstruction, visitUnconditionalBranch, visitVariableLengthInstruction

Field Details

_cp

private ConstantPoolGen _cp

_mg

private MethodGen _mg

_out

private PrintWriter _out

branch_map

private Map branch_map

branches

private List branches

Constructor Details

BCELFactory

(package private)  BCELFactory(MethodGen mg,
                               PrintWriter out)

Method Details

createConstant

private void createConstant(Object value)

start

public void start()

updateBranchTargets

private void updateBranchTargets()

updateExceptionHandlers

private void updateExceptionHandlers()

visitAllocationInstruction

public void visitAllocationInstruction(AllocationInstruction i)
Specified by:
visitAllocationInstruction in interface Visitor
Overrides:
visitAllocationInstruction in interface EmptyVisitor

visitArrayInstruction

public void visitArrayInstruction(ArrayInstruction i)
Specified by:
visitArrayInstruction in interface Visitor
Overrides:
visitArrayInstruction in interface EmptyVisitor

visitBranchInstruction

public void visitBranchInstruction(BranchInstruction bi)
Specified by:
visitBranchInstruction in interface Visitor
Overrides:
visitBranchInstruction in interface EmptyVisitor

visitCHECKCAST

public void visitCHECKCAST(CHECKCAST i)
Specified by:
visitCHECKCAST in interface Visitor
Overrides:
visitCHECKCAST in interface EmptyVisitor

visitConstantPushInstruction

public void visitConstantPushInstruction(ConstantPushInstruction i)
Specified by:
visitConstantPushInstruction in interface Visitor
Overrides:
visitConstantPushInstruction in interface EmptyVisitor

visitFieldInstruction

public void visitFieldInstruction(FieldInstruction i)
Specified by:
visitFieldInstruction in interface Visitor
Overrides:
visitFieldInstruction in interface EmptyVisitor

visitINSTANCEOF

public void visitINSTANCEOF(INSTANCEOF i)
Specified by:
visitINSTANCEOF in interface Visitor
Overrides:
visitINSTANCEOF in interface EmptyVisitor

visitInstruction

private boolean visitInstruction(Instruction i)

visitInvokeInstruction

public void visitInvokeInstruction(InvokeInstruction i)
Specified by:
visitInvokeInstruction in interface Visitor
Overrides:
visitInvokeInstruction in interface EmptyVisitor

visitLDC

public void visitLDC(LDC i)
Specified by:
visitLDC in interface Visitor
Overrides:
visitLDC in interface EmptyVisitor

visitLDC2_W

public void visitLDC2_W(LDC2_W i)
Specified by:
visitLDC2_W in interface Visitor
Overrides:
visitLDC2_W in interface EmptyVisitor

visitLocalVariableInstruction

public void visitLocalVariableInstruction(LocalVariableInstruction i)
Specified by:
visitLocalVariableInstruction in interface Visitor
Overrides:
visitLocalVariableInstruction in interface EmptyVisitor

visitRET

public void visitRET(RET i)
Specified by:
visitRET in interface Visitor
Overrides:
visitRET in interface EmptyVisitor

visitReturnInstruction

public void visitReturnInstruction(ReturnInstruction i)
Specified by:
visitReturnInstruction in interface Visitor
Overrides:
visitReturnInstruction in interface EmptyVisitor