package jenkins.python.expoint; import hudson.Extension; import hudson.ExtensionList; import hudson.ExtensionPoint; import jenkins.model.Jenkins; import hudson.model.Run; import hudson.util.TimeUnit2; import org.jvnet.tiger_types.Types; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.WebMethod; import javax.servlet.ServletException; import java.io.IOException; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.net.URL; import hudson.console.*; import hudson.console.ConsoleAnnotatorFactory.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.console.ConsoleAnnotatorFactory */ public abstract class ConsoleAnnotatorFactoryPW<T> extends ConsoleAnnotatorFactory<T> { private transient PythonExecutor pexec; private void initPython() { if (pexec == null) { pexec = new PythonExecutor(this); String[] jMethods = new String[1]; jMethods[0] = "newInstance"; String[] pFuncs = new String[1]; pFuncs[0] = "new_instance"; Class[][] argTypes = new Class[1][]; argTypes[0] = new Class[1]; argTypes[0][0] = null; pexec.checkAbstrMethods(jMethods, pFuncs, argTypes); String[] functions = new String[5]; functions[0] = "type"; functions[1] = "has_script"; functions[2] = "has_stylesheet"; functions[3] = "do_script_js"; functions[4] = "do_style_css"; int[] argsCount = new int[5]; argsCount[0] = 0; argsCount[1] = 0; argsCount[2] = 0; argsCount[3] = 2; argsCount[4] = 2; pexec.registerFunctions(functions, argsCount); } } @Override public ConsoleAnnotator newInstance(T context) { initPython(); return (ConsoleAnnotator) pexec.execPython("new_instance", context); } @Override public Class type() { initPython(); if (pexec.isImplemented(0)) { return (Class) pexec.execPython("type"); } else { return super.type(); } } @Override public boolean hasScript() { initPython(); if (pexec.isImplemented(1)) { return pexec.execPythonBool("has_script"); } else { return super.hasScript(); } } @Override public boolean hasStylesheet() { initPython(); if (pexec.isImplemented(2)) { return pexec.execPythonBool("has_stylesheet"); } else { return super.hasStylesheet(); } } @Override @WebMethod(name = "script.js") public void doScriptJs(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { initPython(); if (pexec.isImplemented(3)) { pexec.execPythonVoid("do_script_js", req, rsp); } else { super.doScriptJs(req, rsp); } } @Override @WebMethod(name = "style.css") public void doStyleCss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { initPython(); if (pexec.isImplemented(4)) { pexec.execPythonVoid("do_style_css", req, rsp); } else { super.doStyleCss(req, rsp); } } public Class superType() { return super.type(); } public boolean superHasScript() { return super.hasScript(); } public boolean superHasStylesheet() { return super.hasStylesheet(); } public void superDoScriptJs(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { super.doScriptJs(req, rsp); } public void superDoStyleCss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { super.doStyleCss(req, rsp); } public Object execPython(String function, Object... params) { initPython(); return pexec.execPython(function, params); } public byte execPythonByte(String function, Object... params) { initPython(); return pexec.execPythonByte(function, params); } public short execPythonShort(String function, Object... params) { initPython(); return pexec.execPythonShort(function, params); } public char execPythonChar(String function, Object... params) { initPython(); return pexec.execPythonChar(function, params); } public int execPythonInt(String function, Object... params) { initPython(); return pexec.execPythonInt(function, params); } public long execPythonLong(String function, Object... params) { initPython(); return pexec.execPythonLong(function, params); } public float execPythonFloat(String function, Object... params) { initPython(); return pexec.execPythonFloat(function, params); } public double execPythonDouble(String function, Object... params) { initPython(); return pexec.execPythonDouble(function, params); } public boolean execPythonBool(String function, Object... params) { initPython(); return pexec.execPythonBool(function, params); } public void execPythonVoid(String function, Object... params) { initPython(); pexec.execPythonVoid(function, params); } }