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


Java Repository.addClass方法代码示例

本文整理汇总了Java中org.apache.bcel.Repository.addClass方法的典型用法代码示例。如果您正苦于以下问题:Java Repository.addClass方法的具体用法?Java Repository.addClass怎么用?Java Repository.addClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.bcel.Repository的用法示例。


在下文中一共展示了Repository.addClass方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitSet

import org.apache.bcel.Repository; //导入方法依赖的package包/类
/** @see com.puppycrawl.tools.checkstyle.bcel.IObjectSetVisitor */
public void visitSet(Set aSet)
{
    // register the JavaClasses in the Repository
    Repository.clearCache();
    Iterator it = aSet.iterator();
    while (it.hasNext()) {
        final JavaClass javaClass = (JavaClass) it.next();
        Repository.addClass(javaClass);
    }

    // visit the visitors
    it = getObjectSetVisitors().iterator();
    while (it.hasNext()) {
        final IObjectSetVisitor visitor = (IObjectSetVisitor) it.next();
        visitor.visitSet(aSet);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:ClassFileSetCheck.java

示例2: rewrite

import org.apache.bcel.Repository; //导入方法依赖的package包/类
void rewrite(JavaClass javaClass, SpawnSignature[] spawnSignatures)
        throws NoSpawningClassException, ClassRewriteFailure, AssumptionFailure {
    String className = javaClass.getClassName();
    SpawningClass spawnableClass = 
        new SpawningClass(javaClass, spawnSignatures, new Debug(d.turnedOn(), 2));
    d.log(0, "%s is a spawning class\n", className);
    d.log(1, "it contains calls with spawn signatures:\n");
    print(spawnableClass.getSpawnSignatures(), 2);
    d.log(1, "rewriting %s\n", className);
    if (spawnableClass.rewrite(analyzer)) {
        Repository.removeClass(javaClass);
        javaClass = spawnableClass.getJavaClass();
        Repository.addClass(javaClass);
        setModified(wrapper.getInfo(javaClass));
    }
}
 
开发者ID:pieterhijma,项目名称:cashmere,代码行数:17,代码来源:SyncRewriter.java

示例3: analyze

import org.apache.bcel.Repository; //导入方法依赖的package包/类
private <T extends IPersistenceDAO> T analyze(Class<T> klass)
        throws Exception {
    DAOAnalysisSimple analysis = amap.get(klass);
    T instance = null;
    if (analysis == null) {
        analysis = new DAOAnalysisSimple(klass);
        analysis.setDebug(true);
        amap.put(klass, analysis);
        instance = klass.cast(createInstance(analysis));
        JavaClass parse =
            new ClassParser(analysis.getClassFile(), instance.getClass()
                    .getCanonicalName()).parse();
        Repository.addClass(parse);
        // new BCELifier(parse, System.out).start();
        // Verifier.main(new String[] { parse.getClassName() });
    } else {
        instance = klass.cast(createInstance(analysis));
    }
    return instance;
}
 
开发者ID:abassouk,项目名称:autodao,代码行数:21,代码来源:DAOAnalysisTest.java

示例4: parse

import org.apache.bcel.Repository; //导入方法依赖的package包/类
/**
 * Parse the class file into a JavaClass object.
 * If succesful, the new JavaClass is entered into the Repository.
 *
 * @return the parsed JavaClass
 * @throws IOException if the class cannot be parsed
 */
public JavaClass parse() throws IOException {
	JavaClass jclass = classParser.parse();
	Repository.addClass(jclass);
	return jclass;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:RepositoryClassParser.java

示例5: parse

import org.apache.bcel.Repository; //导入方法依赖的package包/类
/**
 * Parse the class file into a JavaClass object. If succesful, the new
 * JavaClass is entered into the Repository.
 * 
 * @return the parsed JavaClass
 * @throws IOException
 *             if the class cannot be parsed
 */
public JavaClass parse() throws IOException {
    JavaClass jclass = classParser.parse();
    Repository.addClass(jclass);
    return jclass;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:14,代码来源:RepositoryClassParser.java


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