Class ForwardingOutput<E extends Exception>

java.lang.Object
io.jstach.jstachio.output.ForwardingOutput<E>
Type Parameters:
E - error throw on any append or write
All Implemented Interfaces:
Output<E>
Direct Known Subclasses:
ForwardingEncodedOutput

public abstract class ForwardingOutput<E extends Exception> extends Object implements Output<E>
An encoded output that forwards all calls to a delegate.
  • Constructor Details

  • Method Details

    • delegate

      protected abstract Output<E> delegate()
      The output to forward to.
      Returns:
      output to forward to.
    • append

      public void append(CharSequence s) throws E
      Description copied from interface: Output
      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      s - unlike appendable always non null.
      Throws:
      E - if an error happens while writting to the appendable
    • append

      public void append(short s) throws E
      Description copied from interface: Output
      Write a short by using String.valueOf(int)
      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      s - short
      Throws:
      E - if an error happens while writting to the appendable
    • append

      public void append(int i) throws E
      Description copied from interface: Output
      Write a int by using String.valueOf(int).

      Implementations should override if they want different behavior or able to support appendables that can write the native type.

      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      i - int
      Throws:
      E - if an error happens while writting to the appendable
    • append

      public void append(long l) throws E
      Description copied from interface: Output
      Write a long by using String.valueOf(long).

      Implementations should override if they want different behavior or able to support appendables that can write the native type.

      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      l - long
      Throws:
      E - if an error happens while writting to the appendable
    • append

      public void append(double d) throws E
      Description copied from interface: Output
      Write a long by using String.valueOf(long).

      Implementations should override if they want different behavior or able to support appendables that can write the native type.

      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      d - double
      Throws:
      E - if an error happens while writting to the appendable
    • append

      public void append(boolean b) throws E
      Description copied from interface: Output
      Write a long by using String.valueOf(long).

      Implementations should override if they want different behavior or able to support appendables that can write the native type.

      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      b - boolean
      Throws:
      E - if an error happens while writting to the appendable
    • toAppendable

      Description copied from interface: Output
      Converts the output to an appendable unless it already is one.
      Specified by:
      toAppendable in interface Output<E extends Exception>
      Returns:
      adapted appendable of this output.
    • append

      public void append(char c) throws E
      Description copied from interface: Output
      Appends a character to an appendable.
      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      c - character
      Throws:
      E - if an error happens while writting to the appendable
    • append

      public void append(String s) throws E
      Description copied from interface: Output
      Analogous to Appendable.append(CharSequence) which by default treats the String as a CharSequence.
      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      s - unlike appendable always non null.
      Throws:
      E - if an error happens while writting to the appendable
    • append

      public void append(CharSequence csq, int start, int end) throws E
      Description copied from interface: Output
      Specified by:
      append in interface Output<E extends Exception>
      Parameters:
      csq - Unlike appendable never null.
      start - start inclusive
      end - end exclusive
      Throws:
      E - if an error happens while writting to the appendable