org.apache.jasper.compiler

Class ServletWriter


public class ServletWriter
extends java.lang.Object

This is what is used to generate servlets.
Authors:
Anil K. Vijendran
Kin-man Chung

Field Summary

static String
SPACES
static int
TAB_WIDTH

Constructor Summary

ServletWriter(PrintWriter writer)

Method Summary

void
close()
int
getJavaLine()
void
popIndent()
void
print(String s)
Prints the given string.
void
print(char c)
Prints the given char.
void
print(int i)
Prints the given int.
void
printComment(org.apache.jasper.compiler.Mark start, org.apache.jasper.compiler.Mark stop, char[] chars)
Print a standard comment for echo outputed chunk.
void
printMultiLn(String s)
Prints the given string.
void
printil(String s)
Prints the current indention, and then the string, and a '\n'.
void
printin()
Prints the current indention
void
printin(String s)
Prints the current indention, followed by the given string
void
println()
Prints a '\n'
void
println(String s)
Prints the given string followed by '\n'
void
pushIndent()

Field Details

SPACES

public static String SPACES

TAB_WIDTH

public static int TAB_WIDTH

Constructor Details

ServletWriter

public ServletWriter(PrintWriter writer)

Method Details

close

public void close()
            throws IOException

getJavaLine

public int getJavaLine()

popIndent

public void popIndent()

print

public void print(String s)
Prints the given string. The string must not contain any '\n', otherwise the line count will be off.

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.

printComment

public void printComment(org.apache.jasper.compiler.Mark start,
                         org.apache.jasper.compiler.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.

printMultiLn

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

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()
Prints a '\n'

println

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

pushIndent

public void pushIndent()

Copyright ?? 2000-2004 Apache Software Foundation. All Rights Reserved.