All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwt.test.internal.GwtClassPool Maven / Gradle / Ivy

There is a newer version: 0.63
Show newest version
package com.googlecode.gwt.test.internal;

import com.googlecode.gwt.test.exceptions.GwtTestPatchException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.NotFoundException;

/**
 * Entry point to the javassist API. For internal use only.
 *
 * @author Gael Lazzari
 */
public class GwtClassPool {

    private static ClassPool classPool = ClassPool.getDefault();

    public static ClassPool get() {
        return classPool;
    }

    public static CtClass getClass(String className) {
        try {
            return GwtClassPool.get().get(className);
        } catch (NotFoundException e) {
            throw new GwtTestPatchException("Cannot find class in the classpath : '" + className + "'");
        }
    }

    public static CtClass getCtClass(Class clazz) {
        return getClass(clazz.getName());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy