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


Java ClassPool.getDefault方法代码示例

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


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

示例1: getCtClass

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
public CtClass getCtClass() {
    CtClass clazz = component.getCtClass();
    if (clazz == null)
        return null;

    ClassPool pool = clazz.getClassPool();
    if (pool == null)
        pool = ClassPool.getDefault();

    String name = arrayName(clazz.getName(), dims);

    try {
        return pool.get(name);
    } catch (NotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:18,代码来源:MultiArrayType.java

示例2: ScopedClassPoolRepositoryImpl

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
/**
 * Singleton.
 */
private ScopedClassPoolRepositoryImpl() {
    classpool = ClassPool.getDefault();
    // FIXME This doesn't look correct
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    classpool.insertClassPath(new LoaderClassPath(cl));
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:10,代码来源:ScopedClassPoolRepositoryImpl.java

示例3: main

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
/**
 * Main method.
 *
 * @param args <code>args[0]</code> is the class file name.
 */
public static void main(String[] args) throws Exception {
    if (args.length != 1) {
        System.err.println("Usage: java javassist.tools.framedump <fully-qualified class name>");
        return;
    }
    
    ClassPool pool = ClassPool.getDefault();
    CtClass clazz = pool.get(args[0]);
    System.out.println("Frame Dump of " + clazz.getName() + ":");
    FramePrinter.print(clazz, System.out);
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:17,代码来源:framedump.java

示例4: processClasses

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
private static void processClasses(CompiledClass[] entries, int n)
    throws Exception
{
    Reflection implementor = new Reflection();
    ClassPool pool = ClassPool.getDefault();
    implementor.start(pool);

    for (int i = 0; i < n; ++i) {
        CtClass c = pool.get(entries[i].classname);
        if (entries[i].metaobject != null
                                    || entries[i].classobject != null) {
            String metaobj, classobj;

            if (entries[i].metaobject == null)
                metaobj = "javassist.tools.reflect.Metaobject";
            else
                metaobj = entries[i].metaobject;

            if (entries[i].classobject == null)
                classobj = "javassist.tools.reflect.ClassMetaobject";
            else
                classobj = entries[i].classobject;

            if (!implementor.makeReflective(c, pool.get(metaobj),
                                          pool.get(classobj)))
                System.err.println("Warning: " + c.getName()
                            + " is reflective.  It was not changed.");

            System.err.println(c.getName() + ": " + metaobj + ", "
                               + classobj);
        }
        else
            System.err.println(c.getName() + ": not reflective");
    }

    for (int i = 0; i < n; ++i) {
        implementor.onLoad(pool, entries[i].classname);
        pool.get(entries[i].classname).writeFile();
    }
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:41,代码来源:Compiler.java

示例5: Loader

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
/**
 * Constructs a new class loader.
 */
public Loader() throws CannotCompileException, NotFoundException {
    super();
    delegateLoadingOf("javassist.tools.reflect.Loader");

    reflection = new Reflection();
    ClassPool pool = ClassPool.getDefault();
    addTranslator(pool, reflection);
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:12,代码来源:Loader.java

示例6: main

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
/**
 * Main method.
 *
 * @param args <code>args[0]</code> is the class file name.
 */
public static void main(String[] args) throws Exception {
    if (args.length != 1) {
        System.err.println("Usage: java framedump <fully-qualified class name>");
        return;
    }
    
    ClassPool pool = ClassPool.getDefault();
    CtClass clazz = pool.get(args[0]);
    System.out.println("Frame Dump of " + clazz.getName() + ":");
    FramePrinter.print(clazz, System.out);
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:17,代码来源:framedump.java

示例7: processClasses

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
private static void processClasses(CompiledClass[] entries, int n)
    throws Exception
{
    Reflection implementor = new Reflection();
    ClassPool pool = ClassPool.getDefault();
    implementor.start(pool);

    for (int i = 0; i < n; ++i) {
        CtClass c = pool.get(entries[i].classname);
        if (entries[i].metaobject != null
                                    || entries[i].classobject != null) {
            String metaobj, classobj;

            if (entries[i].metaobject == null)
                metaobj = "Metaobject";
            else
                metaobj = entries[i].metaobject;

            if (entries[i].classobject == null)
                classobj = "ClassMetaobject";
            else
                classobj = entries[i].classobject;

            if (!implementor.makeReflective(c, pool.get(metaobj),
                                          pool.get(classobj)))
                System.err.println("Warning: " + c.getName()
                            + " is reflective.  It was not changed.");

            System.err.println(c.getName() + ": " + metaobj + ", "
                               + classobj);
        }
        else
            System.err.println(c.getName() + ": not reflective");
    }

    for (int i = 0; i < n; ++i) {
        implementor.onLoad(pool, entries[i].classname);
        pool.get(entries[i].classname).writeFile();
    }
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:41,代码来源:Compiler.java

示例8: Loader

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
/**
 * Constructs a new class loader.
 */
public Loader() throws CannotCompileException, NotFoundException {
    super();
    delegateLoadingOf("Loader");

    reflection = new Reflection();
    ClassPool pool = ClassPool.getDefault();
    addTranslator(pool, reflection);
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:12,代码来源:Loader.java

示例9: getClassPool

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
private ClassPool getClassPool(Type rootComponent) {
    ClassPool pool = rootComponent.clazz.getClassPool();
    return pool != null ? pool : ClassPool.getDefault();
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:5,代码来源:Type.java

示例10: AppletServer

import scouter.javassist.ClassPool; //导入方法依赖的package包/类
/**
 * Constructs a web server.
 *
 * @param port      port number
 */
public AppletServer(int port)
    throws IOException, NotFoundException, CannotCompileException
{
    this(ClassPool.getDefault(), new StubGenerator(), port);
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:11,代码来源:AppletServer.java


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