; PSPad clip definition file for Java
; Created by PSPad 14.7.2002
; Author: Jan Fiala pspad@wo.cz
; Extended by Ekkehard Kögel, 11.7.2005
[prog | Java program - base]
public class |MyProg {
/**
* code description.
*/
public static void main(String[] args) {
/* multiline comments */
// single line comments
System.out.println("Hello world");
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object o) {
if (!(o instanceof ${type})) {
return false;
}
${type} other = (${type}) o;
return other.${name}.equals(this.${name});
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(this.getClass().getName())
.append(": attribute1")
.append(" attribute2");
return sb.toString();
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return this.${name}.hashCode();
}
}
;
[servlet | Java Servlet - base]
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class |MyServlet extends HttpServlet {
PrintWriter out;
public void doGet(HttpServletRequest req, HttpServletResponse res) {
try {
res.setContentType("text/html");
out = res.getWriter();
String html = "Hello, world";
out.println(html);
}
catch (Exception e) { e.printStackTrace(); }
}
public void doPost(HttpServletRequest req, HttpServletResponse res) {
try {
res.setContentType("text/html");
out = res.getWriter();
String html = "Hello, world";
out.println(html);
}
catch (Exception e) { e.printStackTrace(); }
}
}
;
[applet | Java Applet - base]
import java.applet.Applet;
import java.awt.Graphics;
public class |MyApplet extends Applet {
/**
* Once invoked after instantiation. Initialises member variables,
* load images or fonts, read parameters.
* The equivalent to a constructor of an application.
* ...
*/
public void init() {}
/**
* Starts execution, especially for threads.
*/
public void start() {}
/**
* Stops execution, especially for threads.
*/
public void stop() {}
/**
* Browser destroys something before terminating the applet.
* For example needed in order to destroy a thread started during
* initialisation of the applet.
*/
public void destroy() {}
/**
* Returns information about the parameters accepted by the applet.
* You can define these parameters in a HTML file by means of a tag.
* On his part this tag is enclosed by the