package jenkins.python.expoint; import hudson.ExtensionPoint; import hudson.Functions; import hudson.MarkupText; import hudson.model.Describable; import jenkins.model.Jenkins; import hudson.model.Run; import hudson.remoting.ObjectInputStreamEx; import hudson.util.IOException2; import hudson.util.IOUtils; import hudson.util.UnbufferedBase64InputStream; import org.apache.commons.codec.binary.Base64OutputStream; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.tools.ant.BuildListener; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.io.Serializable; import java.io.Writer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.GZIPOutputStream; import hudson.console.*; import hudson.console.ConsoleNote.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.console.ConsoleNote */ public abstract class ConsoleNotePW<T> extends ConsoleNote<T> { private transient PythonExecutor pexec; private void initPython() { if (pexec == null) { pexec = new PythonExecutor(this); String[] jMethods = new String[1]; jMethods[0] = "annotate"; String[] pFuncs = new String[1]; pFuncs[0] = "annotate"; Class[][] argTypes = new Class[1][]; argTypes[0] = new Class[3]; argTypes[0][0] = null; argTypes[0][1] = MarkupText.class; argTypes[0][2] = int.class; pexec.checkAbstrMethods(jMethods, pFuncs, argTypes); String[] functions = new String[4]; functions[0] = "get_descriptor"; functions[1] = "encode_to"; functions[2] = "encode_to"; functions[3] = "encode"; int[] argsCount = new int[4]; argsCount[0] = 0; argsCount[1] = 1; argsCount[2] = 1; argsCount[3] = 0; pexec.registerFunctions(functions, argsCount); } } @Override public ConsoleAnnotator annotate(T context, MarkupText text, int charPos) { initPython(); return (ConsoleAnnotator) pexec.execPython("annotate", context, text, DataConvertor.fromInt(charPos)); } @Override public ConsoleAnnotationDescriptor getDescriptor() { initPython(); if (pexec.isImplemented(0)) { return (ConsoleAnnotationDescriptor) pexec.execPython("get_descriptor"); } else { return super.getDescriptor(); } } @Override public void encodeTo(OutputStream out) throws IOException { initPython(); if (pexec.isImplemented(1)) { pexec.execPythonVoid("encode_to", out); } else { super.encodeTo(out); } } @Override public void encodeTo(Writer out) throws IOException { initPython(); if (pexec.isImplemented(2)) { pexec.execPythonVoid("encode_to", out); } else { super.encodeTo(out); } } @Override public String encode() throws IOException { initPython(); if (pexec.isImplemented(3)) { return (String) pexec.execPython("encode"); } else { return super.encode(); } } public ConsoleAnnotationDescriptor superGetDescriptor() { return super.getDescriptor(); } public void superEncodeTo(OutputStream out) throws IOException { super.encodeTo(out); } public void superEncodeTo(Writer out) throws IOException { super.encodeTo(out); } public String superEncode() throws IOException { return super.encode(); } 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); } }