Class JspWriter

java.lang.Object
java.io.Writer
javax.servlet.jsp.JspWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
Direct Known Subclasses:
DefaultJspWriter

public abstract class JspWriter extends Writer
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

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected int
     
    static final int
    Constant indicating that the Writer is not buffering output.
    static final int
    Constant indicating that the Writer is buffered and is unbounded.

    Fields inherited from class java.io.Writer

    lock
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    JspWriter(int bufferSize, boolean autoFlush)
    Protected constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Clear the contents of the buffer.
    abstract void
    Clears the current contents of the buffer.
    abstract void
    Close the stream.
    abstract void
    Flush the stream.
    int
     
    abstract int
     
    boolean
     
    abstract void
    Write a line separator.
    abstract void
    print(boolean b)
    Print a boolean value.
    abstract void
    print(char c)
    Print a character.
    abstract void
    print(char[] s)
    Print an array of characters.
    abstract void
    print(double d)
    Print a double-precision floating-point number.
    abstract void
    print(float f)
    Print a floating-point number.
    abstract void
    print(int i)
    Print an integer.
    abstract void
    print(long l)
    Print a long integer.
    abstract void
    Print an object.
    abstract void
    Print a string.
    abstract void
    Terminate the current line by writing the line separator string.
    abstract void
    println(boolean x)
    Print a boolean value and then terminate the line.
    abstract void
    println(char x)
    Print a character and then terminate the line.
    abstract void
    println(char[] x)
    Print an array of characters and then terminate the line.
    abstract void
    println(double x)
    Print a double-precision floating-point number and then terminate the line.
    abstract void
    println(float x)
    Print a floating-point number and then terminate the line.
    abstract void
    println(int x)
    Print an integer and then terminate the line.
    abstract void
    println(long x)
    Print a long integer and then terminate the line.
    abstract void
    Print an Object and then terminate the line.
    abstract void
    Print a String and then terminate the line.

    Methods inherited from class java.io.Writer

    append, append, append, nullWriter, write, write, write, write, write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NO_BUFFER

      public static final int NO_BUFFER
      Constant indicating that the Writer is not buffering output.
      See Also:
    • UNBOUNDED_BUFFER

      public static final int UNBOUNDED_BUFFER
      Constant 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 JspWriter
      autoFlush - whether the JspWriter should be autoflushing
  • Method Details

    • newLine

      public abstract void newLine() throws IOException
      Write a line separator.
      Throws:
      IOException
    • print

      public abstract void print(boolean b) throws IOException
      Print a boolean value.
      Throws:
      IOException
    • print

      public abstract void print(char c) throws IOException
      Print a character.
      Throws:
      IOException
    • print

      public abstract void print(int i) throws IOException
      Print an integer.
      Throws:
      IOException
    • print

      public abstract void print(long l) throws IOException
      Print a long integer.
      Throws:
      IOException
    • print

      public abstract void print(float f) throws IOException
      Print a floating-point number.
      Throws:
      IOException
    • print

      public abstract void print(double d) throws IOException
      Print a double-precision floating-point number.
      Throws:
      IOException
    • print

      public abstract void print(char[] s) throws IOException
      Print an array of characters.
      Throws:
      IOException
    • print

      public abstract void print(String s) throws IOException
      Print a string.
      Throws:
      IOException
    • print

      public abstract void print(Object obj) throws IOException
      Print an object.
      Throws:
      IOException
    • println

      public abstract void println() throws IOException
      Terminate the current line by writing the line separator string.
      Throws:
      IOException
    • println

      public abstract void println(boolean x) throws IOException
      Print a boolean value and then terminate the line.
      Throws:
      IOException
    • println

      public abstract void println(char x) throws IOException
      Print a character and then terminate the line.
      Throws:
      IOException
    • println

      public abstract void println(int x) throws IOException
      Print an integer and then terminate the line.
      Throws:
      IOException
    • println

      public abstract void println(long x) throws IOException
      Print a long integer and then terminate the line.
      Throws:
      IOException
    • println

      public abstract void println(float x) throws IOException
      Print a floating-point number and then terminate the line.
      Throws:
      IOException
    • println

      public abstract void println(double x) throws IOException
      Print a double-precision floating-point number and then terminate the line.
      Throws:
      IOException
    • println

      public abstract void println(char[] x) throws IOException
      Print an array of characters and then terminate the line.
      Throws:
      IOException
    • println

      public abstract void println(String x) throws IOException
      Print a String and then terminate the line.
      Throws:
      IOException
    • println

      public abstract void println(Object x) throws IOException
      Print an Object and then terminate the line.
      Throws:
      IOException
    • clear

      public abstract void clear() throws IOException
      Clear the contents of the buffer.
      Throws:
      IOException
    • clearBuffer

      public abstract void clearBuffer() throws IOException
      Clears the current contents of the buffer.
      Throws:
      IOException
    • flush

      public abstract void flush() throws IOException
      Flush the stream.
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in class Writer
      Throws:
      IOException
    • close

      public abstract void close() throws IOException
      Close the stream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class Writer
      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