当前位置: 首页>>代码示例>>Java>>正文


Java Visitor类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:VisitorSet.java

示例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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:14,代码来源:VisitorSet.java

示例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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:VisitorSet.java

示例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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:VisitorSet.java

示例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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:VisitorSet.java

示例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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:VisitorSet.java

示例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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:VisitorSet.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:ClassFileSetCheck.java

示例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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:JavaClassWalker.java


注:本文中的org.apache.bcel.classfile.Visitor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。