Package org.apache.jasper.compiler
Class ServletWriter
- java.lang.Object
- 
- org.apache.jasper.compiler.ServletWriter
 
- 
- All Implemented Interfaces:
- java.lang.AutoCloseable
 
 public class ServletWriter extends java.lang.Object implements java.lang.AutoCloseableThis is what is used to generate servlets.- Author:
- Anil K. Vijendran, Kin-man Chung
 
- 
- 
Constructor SummaryConstructors Constructor Description ServletWriter(java.io.PrintWriter writer)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intgetJavaLine()voidpopIndent()voidprint(char c)Prints the given char.voidprint(int i)Prints the given int.voidprint(java.lang.String s)Prints the given string.voidprintil(java.lang.String s)Prints the current indentation, and then the string, and a '\n'.voidprintin()Prints the current indentationvoidprintin(java.lang.String s)Prints the current indentation, followed by the given stringvoidprintln()Prints a '\n'voidprintln(java.lang.String s)Prints the given string followed by '\n'voidprintMultiLn(java.lang.String s)Prints the given string.voidpushIndent()
 
- 
- 
- 
Method Detail- 
closepublic void close() - Specified by:
- closein interface- java.lang.AutoCloseable
 
 - 
getJavaLinepublic int getJavaLine() 
 - 
pushIndentpublic void pushIndent() 
 - 
popIndentpublic void popIndent() 
 - 
printlnpublic void println(java.lang.String s) Prints the given string followed by '\n'- Parameters:
- s- The string
 
 - 
printlnpublic void println() Prints a '\n'
 - 
printinpublic void printin() Prints the current indentation
 - 
printinpublic void printin(java.lang.String s) Prints the current indentation, followed by the given string- Parameters:
- s- The string
 
 - 
printilpublic void printil(java.lang.String s) Prints the current indentation, and then the string, and a '\n'.- Parameters:
- s- The string
 
 - 
printpublic void print(char c) Prints the given char. Use println() to print a '\n'.- Parameters:
- c- The char
 
 - 
printpublic void print(int i) Prints the given int.- Parameters:
- i- The int
 
 - 
printpublic void print(java.lang.String s) Prints the given string. The string must not contain any '\n', otherwise the line count will be off.- Parameters:
- s- The string
 
 - 
printMultiLnpublic void printMultiLn(java.lang.String s) Prints the given string. If the string spans multiple lines, the line count will be adjusted accordingly.- Parameters:
- s- The string
 
 
- 
 
-