Você pode reduzir o número de pressionamentos de tecla ao digitar o código Java digitando abreviações para gerar código a partir de modelos. A abreviação é expandida para o modelo depois que você pressiona a tecla Tab. Os modelos de código também aparecem quando você usa auto-completar de código ao editar arquivos Java.
O IDE vem com um conjunto de modelos de código. Você também pode criar seus próprios modelos de código.
Segue-se abaixo a lista de modelos de código que o IDE fornece por padrão.
Abreviatura | Modelo de código |
---|---|
En | Enumeração |
Ex | Exceção |
Ob | Object |
Psf | public static final |
Psfb | public static final boolean |
Psfi | public static final int |
Psfs | public static final String |
St | Seqüência |
ab | abstract |
bo | booleano |
br | break |
ca | catch ( |
cl | classe |
cn | continue |
df | default: |
dowhile | do { } while (condition); |
eq | igual |
ex | estende |
fa | false |
fi | final |
fl | float |
forc | for (Iterator it = collection.iterator(); it.hasNext();) { Object elem = (Object) it.next(); } |
fore | for (Object elem : iterable) { } |
fori | for (int i = 0; i < SCRAMBLED_WORD_LIST.length; i++) { } |
fy | finally |
ie | interface |
ifelse | if (condition) { } else { } |
im | implements |
iof | instanceof |
ir | importação |
le | length |
newo | Object name = new Object(args); |
pe | protegido |
pr | privado |
psf | private static final |
psfb | private static final boolean |
psfi | private static final int |
psfs | private static final String |
pst | printStackTrace(); |
psvm | public static void main(String[] args) { } |
pu | público |
re | return |
serr | System.err.println("|"); |
sout | System.out.println("|") |
st | static |
sw | switch ( |
sy | synchronized |
tds | Thread.dumpStack(); |
th | throws |
trycatch | try { } catch (Exception e) { } |
tw | throw |
twn | throw new |
wh | While ( |
whilei | while (it.hasNext()) { Object elem = (Object) it.next(); } |
Abreviatura | Modelo de código |
---|---|
ag | application.getAttribute("|") |
ap | application.putAttribute("|",) |
ar | application.removeAttribute("|") |
cfgi | config.getInitParameter("|") |
jspf | <jsp:forward page="|"/> |
jspg | <jsp:getProperty name="|" property="|"/> |
jspi | <jsp:include page="|"/> |
jspp | <jsp:plugin type="|" code="" codebase=""> </jsp:plugin> |
jsps | <jsp:setProperty name="|" property=""/> |
jspu | <jsp:useBean id="|" type=""/> |
oup | out.print("|") |
oupl | out.println("|") |
pcg | pageContext.getAttribute("|") |
pcgn | pageContext.getAttributeNamesInScope("|") |
pcgs | pageContext.getAttributesScope("|") |
pcr | pageContext.removeAttribute("|") |
pcs | pageContext.setAttribute("|",) |
pg | <%@page |%> |
pga | <%@ page autoFlush="false"%> |
pgb | <%@ page buffer="|kb"%> |
pgc | <%@page contentType="|"%> |
pgerr | <%@page errorPage="|"%> |
pgex | <%@page extends="|"%> |
pgie | <%@page isErrorPage="true"%> |
pgim | <%@page import="|"%> |
pgin | <%@page info="|"%> |
pgit | <%@page isThreadSafe="false"%> |
pgl | <%@page language="java"%> |
pgs | <%@page session="false"%> |
rg | request.getParameter("|") |
sg | session.getAttribute("|") |
sp | session.setAttribute("|", ) |
sr | session.removeAttribute("|") |
tglb | <%@taglib uri="|"%> |