1 <?xml version="1.0" encoding="UTF-8"?>
4 (c) Copyright IBM Corp. 2000, 2001.
12 <template description="iterate over array" name="for" context="php"
13 >for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
17 <template description="iterate over array w/ temporary variable" name="for" context="php"
18 >for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
19 ${array_type} ${array_element} = ${array}[${index}];
23 <template description="iterate over collection" name="for" context="php"
24 >for (Iterator ${iterator} = ${collection}.iterator(); ${iterator}.hasNext(); ) {
25 ${type} ${element} = (${type}) ${iterator}.next();
29 <template description="iterate with enumeration" name="while" context="php"
30 >while (${enumeration}.hasMoreElements()) {
31 ${type} ${element} = (${type}) ${enumeration}.nextElement();
35 <template description="iterate with iterator" name="while" context="php"
36 >while (${iterator}.hasNext()) {
37 ${type} ${element} = (${type}) ${iterator}.next();
41 <template description="do while statement" name="do" context="php"
44 } while (${condition});</template>
46 <template description="switch case statement" name="switch" context="php"
56 <template description="if statement" name="if" context="php"
61 <template description="if else statement" name="ifelse" context="php"
68 <template description="else if block" name="elseif" context="php"
69 >else if (${condition}) {
73 <template description="else block" name="else" context="php"
78 <template description="try catch block" name="try" context="php"
81 } catch (${Exception} e) {
84 <template description="catch block" name="catch" context="php"
85 >catch (${Exception} e) {
89 <template description="main method" name="main" context="php"
91 public static void main(String[] args) {
95 <template description="public method" name="public_method" context="php"
97 public ${return_type} ${name}(${arguments}) {
101 <template description="protected method" name="protected_method" context="php"
102 >protected ${return_type} ${name}(${arguments}) {
106 <template description="private method" name="private_method" context="php"
107 >private ${return_type} ${name}(${arguments}) {
111 <template description="private static method" name="private_static_method" context="php"
112 >private static ${return_type} ${name}(${arguments}) {
116 <template description="dynamic type test and cast" name="instanceof" context="php"
117 >if (${name} instanceof ${type}) {
118 ${type} ${new_name} = (${type})${name};
122 <template description="dynamic cast" name="cast" context="php"
123 >${type} ${new_name} = (${type}) ${name};
126 <template description="create new object" name="new" context="php"
127 >${type} ${name} = new ${type}(${arguments});
130 <template description="lazy creation" name="lazy" context="php"
131 >if (${name} == null) {
132 ${name} = new ${type}(${arguments});
139 <template description="convert collection to array" name="toarray" context="php"
140 >(${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]);</template>
142 <template context="php" description="file comment used by the class and interface wizards" enabled="true" name="filecomment">/**
145 * To change this generated comment edit the template variable "filecomment":
146 * Window>Preferences>Java>Templates.
147 * To enable and disable the creation of file comments go to
148 * Window>Preferences>Java>Code Generation.
151 <template name="typecomment" description="type comment used by the class and interface wizards" context="php" enabled="true">/**
154 * To change this generated comment edit the template variable "typecomment":
155 * Window>Preferences>Java>Templates.
156 * To enable and disable the creation of type comments go to
157 * Window>Preferences>Java>Code Generation.
160 <template description="print to standard out" name="stdout" context="php"
161 >System.out.println(${cursor});</template>
163 <template description="print to standard error" name="stderr" context="php"
164 >System.err.println(${cursor});</template>
168 <template description="<code></code>" name="<code>" context="html"
169 ><code>${cursor}</code></template>
171 <template description="<code>null</code>" name="<code>" context="html"
172 ><code>null</code></template>
174 <template description="<pre></pre>" name="<pre>" context="html"
175 ><pre>${cursor}</pre></template>
177 <template description="<b></b>" name="<b>" context="html"
178 ><b>${cursor}</b></template>
180 <template description="<i></i>" name="<i>" context="html"
181 ><i>${cursor}</i></template>
183 <template description="author name" name="@author" context="html"
184 >@author ${user}</template>