Package org.apache.jasper.compiler
Class ServletWriter
- java.lang.Object
-
- org.apache.jasper.compiler.ServletWriter
-
public class ServletWriter extends java.lang.ObjectThis is what is used to generate servlets.
-
-
Constructor Summary
Constructors Constructor Description ServletWriter(java.io.PrintWriter writer)
-
Method Summary
All 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.voidprintComment(Mark start, Mark stop, char[] chars)Print a standard comment for echo outputed chunk.voidprintil(java.lang.String s)Prints the current indention, and then the string, and a '\n'.voidprintin()Prints the current indentionvoidprintin(java.lang.String s)Prints the current indention, 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()
-
-
-
Field Detail
-
TAB_WIDTH
public static final int TAB_WIDTH
- See Also:
- Constant Field Values
-
SPACES
public static final java.lang.String SPACES
- See Also:
- Constant Field Values
-
indent
private int indent
-
virtual_indent
private int virtual_indent
-
writer
java.io.PrintWriter writer
-
javaLine
private int javaLine
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
getJavaLine
public int getJavaLine()
-
pushIndent
public void pushIndent()
-
popIndent
public void popIndent()
-
printComment
public void printComment(Mark start, Mark stop, char[] chars)
Print a standard comment for echo outputed chunk.- Parameters:
start- The starting position of the JSP chunk being processed.stop- The ending position of the JSP chunk being processed.
-
println
public void println(java.lang.String s)
Prints the given string followed by '\n'
-
println
public void println()
Prints a '\n'
-
printin
public void printin()
Prints the current indention
-
printin
public void printin(java.lang.String s)
Prints the current indention, followed by the given string
-
printil
public void printil(java.lang.String s)
Prints the current indention, and then the string, and a '\n'.
-
print
public void print(char c)
Prints the given char. Use println() to print a '\n'.
-
print
public void print(int i)
Prints the given int.
-
print
public void print(java.lang.String s)
Prints the given string. The string must not contain any '\n', otherwise the line count will be off.
-
printMultiLn
public void printMultiLn(java.lang.String s)
Prints the given string. If the string spans multiple lines, the line count will be adjusted accordingly.
-
-