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

com.googlecode.gwt.test.internal.patchers.GwtFinderPatcher Maven / Gradle / Ivy

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

import com.googlecode.gwt.test.finder.GwtFinder;
import com.googlecode.gwt.test.patchers.InitMethod;
import com.googlecode.gwt.test.patchers.PatchClass;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;

import java.lang.reflect.Modifier;

@PatchClass(GwtFinder.class)
class GwtFinderPatcher {

    @InitMethod
    static void initClass(CtClass c) throws Exception {
        makeMethodPublicStatic(c, "onAttach");
        makeMethodPublicStatic(c, "onDetach");
        makeMethodPublicStatic(c, "onSetHTML");
        makeMethodPublicStatic(c, "onSetId");
        makeMethodPublicStatic(c, "onSetName");
        makeMethodPublicStatic(c, "onSetText");

    }

    private static void makeMethodPublicStatic(CtClass c, String methodName)
            throws NotFoundException {
        CtMethod method = c.getDeclaredMethod(methodName);
        method.setModifiers(Modifier.PUBLIC + Modifier.STATIC);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy