## org.eclipse.jet
Interface BufferedJET2Writer

All Superinterfaces:
  JET2Writer

All Known Implementing Classes:
  BodyContentWriter

    public interface BufferedJET2Writer

extends JET2Writer

Protocol defining a buffered writer for JET. A buffered writer does not write directly to an output source. Instead, it writes to an internal buffer that may be later retrieved and modified.

This interface is not intended to be implemented by clients.

Since:
  0.8.0

Method Summary
`java.lang.Object` `getAdapter(java.lang.Class adapterClass)` Adapt the writer to the given class.
`java.lang.String` `getContent()` Return the buffered content of the writer as a string.
`java.lang.String` `getContent(int offset, int length)` Return a ranged of text within the buffered cotnent of the writer.
`int` `getContentLength()` Return the length of the buffered content.
`void` `replaceContent(int offset, int length, java.lang.String text)` Replace content in the buffer.
`void` `setContent(java.lang.String content)` Set the buffer content, removing any previously written content.

Methods inherited from interface org.eclipse.jet.JET2Writer
`addEventListener, addPosition, addPositionCategory, getDocument, getEventListeners, getLength, getParentWriter, getPositions, newNestedContentWriter, replace, write, write, write, write, write, write, write, write, write, write`

Method Detail

### getContentLength

    int getContentLength()

  Return the length of the buffered content.

  Returns:
    the length

### getContent

    java.lang.String getContent()

  Return the buffered content of the writer as a string.

  Returns:
    the content

### getContent

    java.lang.String getContent(int offset,
                                int length)

  Return a ranged of text within the buffered cotnent of the writer.

  Parameters:
    `offset` - the offset of the text to return
    `length` - the length of the text to return
  Returns:
    the content
  Throws:
    `java.lang.IllegalArgumentException` - if offset or length do not fail within the current contents

### replaceContent

    void replaceContent(int offset,
                        int length,
                        java.lang.String text)

  Replace content in the buffer.

  Parameters:
    `offset` - the offset of the text to replace
    `length` - the length of the text to replace
    `text` - the replacement text
  Throws:
    `java.lang.IllegalArgumentException` - if offset or length do not fall within the current contents

### setContent

    void setContent(java.lang.String content)

  Set the buffer content, removing any previously written content.

  Parameters:
    `content` -

### getAdapter

    java.lang.Object getAdapter(java.lang.Class adapterClass)

  Adapt the writer to the given class. The primary use of this method is to access the underlying buffer implementation.

  Parameters:
    `adapterClass` - the class to return
  Returns:
    the adapter or `null` if adapterClass is not supported.

Copyright 2006 IBM Corporation and others. All Rights Reserved.