Package org.apache.jasper.compiler
Class ServletWriter
java.lang.Object
org.apache.jasper.compiler.ServletWriter
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
NewlineReductionServletWriter
This is what is used to generate servlets.
- Author:
- Anil K. Vijendran, Kin-man Chung
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
void
void
print
(char c) Prints the given char.void
print
(int i) Prints the given int.void
Prints the given string.void
Prints the current indentation, and then the string, and a '\n'.void
printin()
Prints the current indentationvoid
Prints the current indentation, followed by the given stringvoid
println()
Prints a '\n'void
Prints the given string followed by '\n'void
Prints the given string.void
-
Constructor Details
-
ServletWriter
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getJavaLine
public int getJavaLine() -
pushIndent
public void pushIndent() -
popIndent
public void popIndent() -
println
-
println
public void println()Prints a '\n' -
printin
public void printin()Prints the current indentation -
printin
Prints the current indentation, followed by the given string- Parameters:
s
- The string
-
printil
Prints the current indentation, and then the string, and a '\n'.- Parameters:
s
- The string
-
print
public void print(char c) Prints the given char. Use println() to print a '\n'.- Parameters:
c
- The char
-
print
public void print(int i) Prints the given int.- Parameters:
i
- The int
-
print
Prints the given string. The string must not contain any '\n', otherwise the line count will be off.- Parameters:
s
- The string
-
printMultiLn
Prints the given string. If the string spans multiple lines, the line count will be adjusted accordingly.- Parameters:
s
- The string
-