Class StringSitemeshBuffer

java.lang.Object
com.opensymphony.module.sitemesh.html.util.StringSitemeshBuffer
All Implemented Interfaces:
SitemeshBuffer

public class StringSitemeshBuffer extends Object implements SitemeshBuffer
SitemeshBuffer that is a string.
  • Constructor Details

    • StringSitemeshBuffer

      public StringSitemeshBuffer(String buffer)
      Instantiates a new string sitemesh buffer.
      Parameters:
      buffer - the buffer
  • Method Details

    • getCharArray

      public char[] getCharArray()
      Description copied from interface: SitemeshBuffer
      Get the char array for this buffer. This array may be longer than the length of the content, you must use getBufferLength() in combination with this method.
      Specified by:
      getCharArray in interface SitemeshBuffer
      Returns:
      The char array for this buffer
    • getBufferLength

      public int getBufferLength()
      Description copied from interface: SitemeshBuffer
      Get the length of the buffered content.
      Specified by:
      getBufferLength in interface SitemeshBuffer
      Returns:
      The length of the buffered content.
    • getTotalLength

      public int getTotalLength()
      Description copied from interface: SitemeshBuffer
      Get the total length of the buffered content, including the length of any chained buffers.
      Specified by:
      getTotalLength in interface SitemeshBuffer
      Returns:
      The total length.
    • getTotalLength

      public int getTotalLength(int start, int length)
      Description copied from interface: SitemeshBuffer
      Get the total length of the buffered content, including chained buffers from start to length.
      Specified by:
      getTotalLength in interface SitemeshBuffer
      Parameters:
      start - Where to start counting the length from
      length - Where to finish
      Returns:
      THe total length in the given range
    • writeTo

      public void writeTo(Writer writer, int start, int length) throws IOException
      Description copied from interface: SitemeshBuffer
      Write this buffer, and any chained sub buffers in the given range, out to the given writer.
      Specified by:
      writeTo in interface SitemeshBuffer
      Parameters:
      writer - The writer to write to
      start - The position to start writing from
      length - The length to write
      Throws:
      IOException - If an error occurred
    • hasFragments

      public boolean hasFragments()
      Description copied from interface: SitemeshBuffer
      Whether the buffer has fragments or not.
      Specified by:
      hasFragments in interface SitemeshBuffer
      Returns:
      True if it has fragments
    • createBufferFragment

      public static SitemeshBufferFragment createBufferFragment(String buffer)
      Creates the buffer fragment.
      Parameters:
      buffer - the buffer
      Returns:
      the sitemesh buffer fragment