Package javax.servlet.jsp
Class JspWriter
java.lang.Object
java.io.Writer
javax.servlet.jsp.JspWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
- Direct Known Subclasses:
DefaultJspWriter
Minimal JSP Writer implementation for Gumdrop JSP support.
This is a basic implementation of the JSP API's JspWriter class, providing the essential functionality needed for JSP page compilation and execution in Gumdrop.
- Author:
- Chris Burdess
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intstatic final intConstant indicating that the Writer is not buffering output.static final intConstant indicating that the Writer is buffered and is unbounded. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJspWriter(int bufferSize, boolean autoFlush) Protected constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclear()Clear the contents of the buffer.abstract voidClears the current contents of the buffer.abstract voidclose()Close the stream.abstract voidflush()Flush the stream.intabstract intbooleanabstract voidnewLine()Write a line separator.abstract voidprint(boolean b) Print a boolean value.abstract voidprint(char c) Print a character.abstract voidprint(char[] s) Print an array of characters.abstract voidprint(double d) Print a double-precision floating-point number.abstract voidprint(float f) Print a floating-point number.abstract voidprint(int i) Print an integer.abstract voidprint(long l) Print a long integer.abstract voidPrint an object.abstract voidPrint a string.abstract voidprintln()Terminate the current line by writing the line separator string.abstract voidprintln(boolean x) Print a boolean value and then terminate the line.abstract voidprintln(char x) Print a character and then terminate the line.abstract voidprintln(char[] x) Print an array of characters and then terminate the line.abstract voidprintln(double x) Print a double-precision floating-point number and then terminate the line.abstract voidprintln(float x) Print a floating-point number and then terminate the line.abstract voidprintln(int x) Print an integer and then terminate the line.abstract voidprintln(long x) Print a long integer and then terminate the line.abstract voidPrint an Object and then terminate the line.abstract voidPrint a String and then terminate the line.
-
Field Details
-
NO_BUFFER
public static final int NO_BUFFERConstant indicating that the Writer is not buffering output.- See Also:
-
UNBOUNDED_BUFFER
public static final int UNBOUNDED_BUFFERConstant indicating that the Writer is buffered and is unbounded.- See Also:
-
bufferSize
protected int bufferSize -
autoFlush
protected boolean autoFlush
-
-
Constructor Details
-
JspWriter
protected JspWriter(int bufferSize, boolean autoFlush) Protected constructor.- Parameters:
bufferSize- the size of the buffer to be used by the JspWriterautoFlush- whether the JspWriter should be autoflushing
-
-
Method Details
-
newLine
Write a line separator.- Throws:
IOException
-
print
Print a boolean value.- Throws:
IOException
-
print
Print a character.- Throws:
IOException
-
print
Print an integer.- Throws:
IOException
-
print
Print a long integer.- Throws:
IOException
-
print
Print a floating-point number.- Throws:
IOException
-
print
Print a double-precision floating-point number.- Throws:
IOException
-
print
Print an array of characters.- Throws:
IOException
-
print
Print a string.- Throws:
IOException
-
print
Print an object.- Throws:
IOException
-
println
Terminate the current line by writing the line separator string.- Throws:
IOException
-
println
Print a boolean value and then terminate the line.- Throws:
IOException
-
println
Print a character and then terminate the line.- Throws:
IOException
-
println
Print an integer and then terminate the line.- Throws:
IOException
-
println
Print a long integer and then terminate the line.- Throws:
IOException
-
println
Print a floating-point number and then terminate the line.- Throws:
IOException
-
println
Print a double-precision floating-point number and then terminate the line.- Throws:
IOException
-
println
Print an array of characters and then terminate the line.- Throws:
IOException
-
println
Print a String and then terminate the line.- Throws:
IOException
-
println
Print an Object and then terminate the line.- Throws:
IOException
-
clear
Clear the contents of the buffer.- Throws:
IOException
-
clearBuffer
Clears the current contents of the buffer.- Throws:
IOException
-
flush
Flush the stream.- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
Close the stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
getBufferSize
public int getBufferSize()- Returns:
- the size of the buffer used by the JspWriter
-
getRemaining
public abstract int getRemaining()- Returns:
- the number of unused bytes in the buffer
-
isAutoFlush
public boolean isAutoFlush()- Returns:
- whether the JspWriter is autoFlushing
-