Package javassist

Examples of javassist.ClassPool.find()


public class Enhancer {

  public <T> Class enhanceResource(Class<T> originalType) {
    ClassPool pool = ClassPool.getDefault();
    if (pool.find(Enhancer.class.getName()) == null) {
      pool.appendClassPath(new LoaderClassPath(getClass().getClassLoader()));
    }
    try {
      // TODO extract this enhancement to an interface and test it appart
      CtClass newType =   pool.makeClass("br.com.caelum.restfulie." + originalType.getSimpleName() + "_" + System.currentTimeMillis());
View Full Code Here


@SuppressWarnings("rawtypes")
public class DefaultEnhancer implements Enhancer {

  public <T> Class enhanceResource(Class<T> originalType) {
    ClassPool pool = ClassPool.getDefault();
    if (pool.find(DefaultEnhancer.class.getName()) == null) {
      pool.appendClassPath(new LoaderClassPath(getClass().getClassLoader()));
    }
    try {
      // TODO extract this enhancement to an interface and test it appart
      CtClass newType =   pool.makeClass(generateNewUniqueClassName(originalType));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.