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(
"com.liferay.faces.jrebel.RendererReloader.reloadTemplates($0,$1);");
}
catch (NotFoundException e) {
CtMethod encodeMarkupBeginMethod = ctClass.getDeclaredMethod("encodeMarkupBegin",
new CtClass[] { facesContextCtClass, uiComponentCtClass });
encodeMarkupBeginMethod.insertBefore(
"com.liferay.faces.jrebel.RendererReloader.reloadTemplates($0,$1);");
}
}
}
}