org.apache.jasper.compiler

Class ServletWriter

public class ServletWriter extends Object

This is what is used to generate servlets.

Author: Anil K. Vijendran Kin-man Chung

Field Summary
static StringSPACES
static intTAB_WIDTH
Constructor Summary
ServletWriter(PrintWriter writer)
Method Summary
voidclose()
intgetJavaLine()
voidpopIndent()
voidprint(char c)
Prints the given char.
voidprint(int i)
Prints the given int.
voidprint(String s)
Prints the given string.
voidprintComment(Mark start, Mark stop, char[] chars)
Print a standard comment for echo outputed chunk.
voidprintil(String s)
Prints the current indention, and then the string, and a '\n'.
voidprintin()
Prints the current indention
voidprintin(String s)
Prints the current indention, followed by the given string
voidprintln(String s)
Prints the given string followed by '\n'
voidprintln()
Prints a '\n'
voidprintMultiLn(String s)
Prints the given string.
voidpushIndent()

Field Detail

SPACES

public static String SPACES

TAB_WIDTH

public static int TAB_WIDTH

Constructor Detail

ServletWriter

public ServletWriter(PrintWriter writer)

Method Detail

close

public void close()

getJavaLine

public int getJavaLine()

popIndent

public void popIndent()

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(String s)
Prints the given string. The string must not contain any '\n', otherwise the line count will be off.

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.

printil

public void printil(String s)
Prints the current indention, and then the string, and a '\n'.

printin

public void printin()
Prints the current indention

printin

public void printin(String s)
Prints the current indention, followed by the given string

println

public void println(String s)
Prints the given string followed by '\n'

println

public void println()
Prints a '\n'

printMultiLn

public void printMultiLn(String s)
Prints the given string. If the string spans multiple lines, the line count will be adjusted accordingly.

pushIndent

public void pushIndent()
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.