Package org.zeroturnaround.bundled.javassist

Examples of org.zeroturnaround.bundled.javassist.CtClass


  @Override
  public void process(ClassPool classPool, ClassLoader classLoader, CtClass ctClass) throws Exception {

    try {

      CtClass rendererCtClass = classPool.get("javax.faces.render.Renderer");

      if (ctClass.subclassOf(rendererCtClass)) {

        CtClass[] ctInterfaces = ctClass.getInterfaces();
        boolean hasInterface = false;

        for (CtClass ctInterface : ctInterfaces) {

          if ("javax.faces.event.SystemEventListener".equals(ctInterface.getName())) {
            hasInterface = true;

            break;
          }
        }

        if (hasInterface) {
          CtClass facesContextCtClass = classPool.get("javax.faces.context.FacesContext");
          CtClass uiComponentCtClass = classPool.get("javax.faces.component.UIComponent");

          try {
            CtMethod encodeBeginMethod = ctClass.getDeclaredMethod("encodeBegin",
                new CtClass[] { facesContextCtClass, uiComponentCtClass });
            encodeBeginMethod.insertBefore(
View Full Code Here

TOP

Related Classes of org.zeroturnaround.bundled.javassist.CtClass

Copyright © 2018 www.massapicom. 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.