• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Repository类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createClassSet

import org.apache.bcel.util.Repository; //导入依赖的package包/类
public static JavaType[] createClassSet( File classes, ClassLoader thirdPartyClasses, ClassFilter classFilter )
    throws MalformedURLException
{
    ClassLoader classLoader = new URLClassLoader( new URL[]{ classes.toURI().toURL() }, thirdPartyClasses );

    Repository repository = new ClassLoaderRepository( classLoader );

    List selected = new ArrayList();

    DirectoryScanner scanner = new DirectoryScanner();
    scanner.setBasedir( classes );
    scanner.setIncludes( new String[]{ "**/*.class" } );
    scanner.scan();

    String[] files = scanner.getIncludedFiles();

    for ( int i = 0; i < files.length; i++ )
    {
        File f = new File( classes, files[i] );
        JavaClass clazz = extractClass( f, repository );
        if ( classFilter.isSelected( clazz ) )
        {
            selected.add( new BcelJavaType( clazz ) );
            repository.storeClass( clazz );
        }
    }

    JavaType[] ret = new JavaType[selected.size()];
    selected.toArray( ret );
    return ret;
}
 
开发者ID:mojohaus,项目名称:clirr-maven-plugin,代码行数:32,代码来源:AbstractClirrMojo.java


示例2: extractClass

import org.apache.bcel.util.Repository; //导入依赖的package包/类
private static JavaClass extractClass( File f, Repository repository )
    throws CheckerException
{
    InputStream is = null;
    try
    {
        is = new FileInputStream( f );

        ClassParser parser = new ClassParser( is, f.getName() );
        JavaClass clazz = parser.parse();
        clazz.setRepository( repository );
        return clazz;
    }
    catch ( IOException ex )
    {
        throw new CheckerException( "Cannot read " + f, ex );
    }
    finally
    {
        IOUtil.close( is );
    }
}
 
开发者ID:mojohaus,项目名称:clirr-maven-plugin,代码行数:23,代码来源:AbstractClirrMojo.java


示例3: storeClass

import org.apache.bcel.util.Repository; //导入依赖的package包/类
public void storeClass(JavaClass javaClass) {
    if (DEBUG)
        System.out.println("Storing class " + javaClass.getClassName() + " in repository");
    JavaClass previous = nameToClassMap.put(javaClass.getClassName(), javaClass);
    if (DEBUG && previous != null) {
        System.out.println("\t==> A previous class was evicted!");
        dumpStack();
    }
    Repository tmp = org.apache.bcel.Repository.getRepository();
    if (tmp != null && tmp != this)
        throw new IllegalStateException("Wrong/multiple BCEL repository");
    if (tmp == null)
        org.apache.bcel.Repository.setRepository(this);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:15,代码来源:URLClassPathRepository.java


示例4: getSuperClasses

import org.apache.bcel.util.Repository; //导入依赖的package包/类
private ArrayList<String> getSuperClasses(Repository repository, JavaClass implem) {
    ArrayList<String> result = new ArrayList<String>();
    String superName = null;
    while ((superName = implem.getSuperclassName()) != null) {
        if (result.contains(superName))
            break;
        result.add(superName);
        try {
            implem = repository.loadClass(superName);
        } catch (ClassNotFoundException e) {
            implem = null;
        }
    }
    return result;
}
 
开发者ID:Orange-OpenSource,项目名称:matos-tool,代码行数:16,代码来源:ImplemCheckerPhase.java


示例5: isCompatible

import org.apache.bcel.util.Repository; //导入依赖的package包/类
@Override
public boolean isCompatible(Repository repository, InputModel input) {
	if (input == null) {
		return false;
	}
	return input.isCompatible(repository, this);
}
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:8,代码来源:OutputModelImpl.java


示例6: ClassScanner

import org.apache.bcel.util.Repository; //导入依赖的package包/类
/**
 * Initializes a new scanner.
 * 
 * @param repository
 *            the Repository to use for loading classes. Must not be <code>null</code>.
 * @param filter
 *            the filter to use. Must not be <code>null</code>.
 */
public ClassScanner(final Repository repository, final ClassFilter filter) {
	if (repository == null) {
		throw new IllegalArgumentException("repository must not be null");
	}
	if (filter == null) {
		throw new IllegalArgumentException("filter must not be null");
	}
	this.repository = repository;
	this.filter = filter;
}
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:19,代码来源:ClassScanner.java


示例7: operateOn

import org.apache.bcel.util.Repository; //导入依赖的package包/类
@Override
public final void operateOn(final ClassGen classGen, final JavaClass clazz, final Repository repository) {
    System.out.println(plugin.getClass().getName() + ": Transforming type " + clazz.getClassName());
    plugin.operateOn(classGen, clazz, repository);
}
 
开发者ID:project-avral,项目名称:oo-atom,代码行数:6,代码来源:VerbosePlugin.java


示例8: operateOn

import org.apache.bcel.util.Repository; //导入依赖的package包/类
@Override
public final void operateOn(final ClassGen classGen, final JavaClass clazz, final Repository repository) {
    // Do nothing
}
 
开发者ID:project-avral,项目名称:oo-atom,代码行数:5,代码来源:NopPlugin.java


示例9: getRepository

import org.apache.bcel.util.Repository; //导入依赖的package包/类
public final Repository getRepository() {
	return repository;
}
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:4,代码来源:FeatureProvider.java


示例10: SynchronizedBCELRepository

import org.apache.bcel.util.Repository; //导入依赖的package包/类
public SynchronizedBCELRepository(final Repository realRepository) {
	this.realRepository = realRepository;
}
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:4,代码来源:SynchronizedBCELRepository.java


示例11: FunctionBlockClass

import org.apache.bcel.util.Repository; //导入依赖的package包/类
/**
 * Initializes a new FunctionBlockClass. This should normally not be called directly, instead use a
 * {@link FunctionBlockClassFactory}.
 * 
 * @param repository
 *            the Repository that should be used to load the class
 * @param className
 *            the name of the class
 * @throws ClassNotFoundException
 *             if the class is not found
 * @throws IllegalArgumentException
 *             if the class is not a {@link FunctionBlock}
 */
public FunctionBlockClass(final Repository repository, final String className) throws ClassNotFoundException {
	this.repository = repository;
	this.blockClass = repository.loadClass(className);
	if (!isFunctionBlock(blockClass)) {
		throw new IllegalArgumentException("not a FunctionBlock class: " + className);
	}
}
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:21,代码来源:FunctionBlockClass.java


示例12: isCompatible

import org.apache.bcel.util.Repository; //导入依赖的package包/类
/**
 * Checks if an {@link Input} is compatible with this Output. An Input is compatible if it takes either the type
 * this Output sends or any supertype of it.
 * 
 * @param repository
 *            the Repository used for inspecting the classes
 * @param input
 *            the Input to check
 * @return true if the input is compatible
 */
boolean isCompatible(Repository repository, InputModel input);
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:12,代码来源:OutputModel.java


示例13: isCompatible

import org.apache.bcel.util.Repository; //导入依赖的package包/类
/**
 * Checks if an {@link Output} is compatible with this Input. An Output is compatible if it sends the type this
 * Input takes or any subtype of it
 * 
 * @param repository
 *            the Repository used for inspecting the classes
 * @param output
 *            the Output to check
 * @return true if the output is compatible
 */
boolean isCompatible(Repository repository, OutputModel output);
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:12,代码来源:InputModel.java


示例14: FunctionBlockClassFactory

import org.apache.bcel.util.Repository; //导入依赖的package包/类
/**
 * Initializes a new FunctionBlockClassFactory with the given Repository. This factory will only be thread-safe if
 * the Repository is not accessed at the same time as methods on this Factory are called.
 * 
 * @param repository
 *            the Repository to use for loading classes
 */
public FunctionBlockClassFactory(final Repository repository) {
	this.repository = new SynchronizedBCELRepository(repository);
}
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:11,代码来源:FunctionBlockClassFactory.java


示例15: operateOn

import org.apache.bcel.util.Repository; //导入依赖的package包/类
void operateOn(ClassGen classGen, JavaClass clazz, Repository repository); 
开发者ID:project-avral,项目名称:oo-atom,代码行数:2,代码来源:Plugin.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MixedEncodingDescriptor类代码示例发布时间:2022-05-22
下一篇:
Java Cache类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap