本文整理汇总了Java中org.apache.bcel.classfile.Visitor类的典型用法代码示例。如果您正苦于以下问题:Java Visitor类的具体用法?Java Visitor怎么用?Java Visitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Visitor类属于org.apache.bcel.classfile包,在下文中一共展示了Visitor类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitCode
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* @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);
}
}
示例2: visitInstructionHandle
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* Deep visit of an InstructionHandle
* @param aInstruction the InstructionHandle
*/
private void visitInstructionHandle(InstructionHandle aInstruction)
{
for (Iterator iter = mVisitors.iterator(); iter.hasNext();) {
final IDeepVisitor visitor = (IDeepVisitor) iter.next();
org.apache.bcel.generic.Visitor v =
visitor.getGenericVisitor();
aInstruction.accept(v);
}
}
示例3: visitConstantPool
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* @see org.apache.bcel.classfile.Visitor
*/
public void visitConstantPool(ConstantPool aConstantPool)
{
for (Iterator iter = mVisitors.iterator(); iter.hasNext();) {
IDeepVisitor visitor = (IDeepVisitor) iter.next();
Visitor v = visitor.getClassFileVisitor();
aConstantPool.accept(v);
}
}
示例4: visitField
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* @see org.apache.bcel.classfile.Visitor
*/
public void visitField(Field aField)
{
for (Iterator iter = mVisitors.iterator(); iter.hasNext();) {
IDeepVisitor visitor = (IDeepVisitor) iter.next();
Visitor v = visitor.getClassFileVisitor();
aField.accept(v);
}
}
示例5: visitJavaClass
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* @see org.apache.bcel.classfile.Visitor
*/
public void visitJavaClass(JavaClass aJavaClass)
{
for (Iterator iter = mVisitors.iterator(); iter.hasNext();) {
IDeepVisitor visitor = (IDeepVisitor) iter.next();
Visitor v = visitor.getClassFileVisitor();
aJavaClass.accept(v);
}
}
示例6: visitLocalVariableTable
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* @see org.apache.bcel.classfile.Visitor
*/
public void visitLocalVariableTable(LocalVariableTable aTable)
{
for (Iterator iter = mVisitors.iterator(); iter.hasNext();) {
IDeepVisitor visitor = (IDeepVisitor) iter.next();
Visitor v = visitor.getClassFileVisitor();
aTable.accept(v);
}
}
示例7: visitMethod
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* @see org.apache.bcel.classfile.Visitor
*/
public void visitMethod(Method aMethod)
{
for (Iterator iter = mVisitors.iterator(); iter.hasNext();) {
IDeepVisitor visitor = (IDeepVisitor) iter.next();
Visitor v = visitor.getClassFileVisitor();
aMethod.accept(v);
}
}
示例8: getTreeVisitor
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* Gets the visitor for a parse tree walk.
* @return the visitor for a parse tree walk.
*/
private Visitor getTreeVisitor()
{
return new VisitorSet(mTreeVisitors);
}
示例9: setVisitor
import org.apache.bcel.classfile.Visitor; //导入依赖的package包/类
/**
* Sets a visitor to be accepted during a traversal.
* @param aVisitor the visitor to be accepted during a traversal.
*/
public void setVisitor(Visitor aVisitor)
{
mVisitor = aVisitor;
}