本文整理汇总了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);
}
}
示例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));
}
示例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);
}
示例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();
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例9: getClassPool
import scouter.javassist.ClassPool; //导入方法依赖的package包/类
private ClassPool getClassPool(Type rootComponent) {
ClassPool pool = rootComponent.clazz.getClassPool();
return pool != null ? pool : ClassPool.getDefault();
}
示例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);
}