javax.swing.text
Class AbstractWriter

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.text.AbstractWriter
Direct Known Subclasses:
HTMLWriter sample code for javax.swing.text.html.HTMLWriter definition code for javax.swing.text.html.HTMLWriter , MinimalHTMLWriter sample code for javax.swing.text.html.MinimalHTMLWriter definition code for javax.swing.text.html.MinimalHTMLWriter

public abstract class AbstractWriter
extends Object sample code for java.lang.Object definition code for java.lang.Object

AbstractWriter is an abstract class that actually does the work of writing out the element tree including the attributes. In terms of how much is written out per line, the writer defaults to 100. But this value can be set by subclasses.


Field Summary
protected static char NEWLINE sample code for javax.swing.text.AbstractWriter.NEWLINE definition code for javax.swing.text.AbstractWriter.NEWLINE
          How the text packages models newlines.
 
Constructor Summary
protected AbstractWriter sample code for javax.swing.text.AbstractWriter.AbstractWriter(java.io.Writer, javax.swing.text.Document) definition code for javax.swing.text.AbstractWriter.AbstractWriter(java.io.Writer, javax.swing.text.Document) (Writer sample code for java.io.Writer definition code for java.io.Writer  w, Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  doc)
          Creates a new AbstractWriter.
protected AbstractWriter sample code for javax.swing.text.AbstractWriter.AbstractWriter(java.io.Writer, javax.swing.text.Document, int, int) definition code for javax.swing.text.AbstractWriter.AbstractWriter(java.io.Writer, javax.swing.text.Document, int, int) (Writer sample code for java.io.Writer definition code for java.io.Writer  w, Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  doc, int pos, int len)
          Creates a new AbstractWriter.
protected AbstractWriter sample code for javax.swing.text.AbstractWriter.AbstractWriter(java.io.Writer, javax.swing.text.Element) definition code for javax.swing.text.AbstractWriter.AbstractWriter(java.io.Writer, javax.swing.text.Element) (Writer sample code for java.io.Writer definition code for java.io.Writer  w, Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  root)
          Creates a new AbstractWriter.
protected AbstractWriter sample code for javax.swing.text.AbstractWriter.AbstractWriter(java.io.Writer, javax.swing.text.Element, int, int) definition code for javax.swing.text.AbstractWriter.AbstractWriter(java.io.Writer, javax.swing.text.Element, int, int) (Writer sample code for java.io.Writer definition code for java.io.Writer  w, Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  root, int pos, int len)
          Creates a new AbstractWriter.
 
Method Summary
protected  void decrIndent sample code for javax.swing.text.AbstractWriter.decrIndent() definition code for javax.swing.text.AbstractWriter.decrIndent() ()
          Decrements the indent level.
protected  boolean getCanWrapLines sample code for javax.swing.text.AbstractWriter.getCanWrapLines() definition code for javax.swing.text.AbstractWriter.getCanWrapLines() ()
          Returns whether or not the lines can be wrapped.
protected  int getCurrentLineLength sample code for javax.swing.text.AbstractWriter.getCurrentLineLength() definition code for javax.swing.text.AbstractWriter.getCurrentLineLength() ()
          Returns the current line length.
protected  Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document getDocument sample code for javax.swing.text.AbstractWriter.getDocument() definition code for javax.swing.text.AbstractWriter.getDocument() ()
          Fetches the document.
protected  ElementIterator sample code for javax.swing.text.ElementIterator definition code for javax.swing.text.ElementIterator getElementIterator sample code for javax.swing.text.AbstractWriter.getElementIterator() definition code for javax.swing.text.AbstractWriter.getElementIterator() ()
          Fetches the ElementIterator.
 int getEndOffset sample code for javax.swing.text.AbstractWriter.getEndOffset() definition code for javax.swing.text.AbstractWriter.getEndOffset() ()
          Returns the last offset to be output.
protected  int getIndentLevel sample code for javax.swing.text.AbstractWriter.getIndentLevel() definition code for javax.swing.text.AbstractWriter.getIndentLevel() ()
          Returns the current indentation level.
protected  int getIndentSpace sample code for javax.swing.text.AbstractWriter.getIndentSpace() definition code for javax.swing.text.AbstractWriter.getIndentSpace() ()
          Returns the amount of space to indent.
protected  int getLineLength sample code for javax.swing.text.AbstractWriter.getLineLength() definition code for javax.swing.text.AbstractWriter.getLineLength() ()
          Returns the maximum line length.
 String sample code for java.lang.String definition code for java.lang.String getLineSeparator sample code for javax.swing.text.AbstractWriter.getLineSeparator() definition code for javax.swing.text.AbstractWriter.getLineSeparator() ()
          Returns the string used to represent newlines.
 int getStartOffset sample code for javax.swing.text.AbstractWriter.getStartOffset() definition code for javax.swing.text.AbstractWriter.getStartOffset() ()
          Returns the first offset to be output.
protected  String sample code for java.lang.String definition code for java.lang.String getText sample code for javax.swing.text.AbstractWriter.getText(javax.swing.text.Element) definition code for javax.swing.text.AbstractWriter.getText(javax.swing.text.Element) (Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  elem)
          Returns the text associated with the element.
protected  Writer sample code for java.io.Writer definition code for java.io.Writer getWriter sample code for javax.swing.text.AbstractWriter.getWriter() definition code for javax.swing.text.AbstractWriter.getWriter() ()
          Returns the Writer that is used to output the content.
protected  void incrIndent sample code for javax.swing.text.AbstractWriter.incrIndent() definition code for javax.swing.text.AbstractWriter.incrIndent() ()
          Increments the indent level.
protected  void indent sample code for javax.swing.text.AbstractWriter.indent() definition code for javax.swing.text.AbstractWriter.indent() ()
          Does indentation.
protected  boolean inRange sample code for javax.swing.text.AbstractWriter.inRange(javax.swing.text.Element) definition code for javax.swing.text.AbstractWriter.inRange(javax.swing.text.Element) (Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  next)
          This method determines whether the current element is in the range specified.
protected  boolean isLineEmpty sample code for javax.swing.text.AbstractWriter.isLineEmpty() definition code for javax.swing.text.AbstractWriter.isLineEmpty() ()
          Returns true if the current line should be considered empty.
protected  void output sample code for javax.swing.text.AbstractWriter.output(char[], int, int) definition code for javax.swing.text.AbstractWriter.output(char[], int, int) (char[] content, int start, int length)
          The last stop in writing out content.
protected  void setCanWrapLines sample code for javax.swing.text.AbstractWriter.setCanWrapLines(boolean) definition code for javax.swing.text.AbstractWriter.setCanWrapLines(boolean) (boolean newValue)
          Sets whether or not lines can be wrapped.
protected  void setCurrentLineLength sample code for javax.swing.text.AbstractWriter.setCurrentLineLength(int) definition code for javax.swing.text.AbstractWriter.setCurrentLineLength(int) (int length)
          Sets the current line length.
protected  void setIndentSpace sample code for javax.swing.text.AbstractWriter.setIndentSpace(int) definition code for javax.swing.text.AbstractWriter.setIndentSpace(int) (int space)
          Enables subclasses to specify how many spaces an indent maps to.
protected  void setLineLength sample code for javax.swing.text.AbstractWriter.setLineLength(int) definition code for javax.swing.text.AbstractWriter.setLineLength(int) (int l)
          Enables subclasses to set the number of characters they want written per line.
 void setLineSeparator sample code for javax.swing.text.AbstractWriter.setLineSeparator(java.lang.String) definition code for javax.swing.text.AbstractWriter.setLineSeparator(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  value)
          Sets the String used to reprsent newlines.
protected  void text sample code for javax.swing.text.AbstractWriter.text(javax.swing.text.Element) definition code for javax.swing.text.AbstractWriter.text(javax.swing.text.Element) (Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  elem)
          Writes out text.
protected abstract  void write sample code for javax.swing.text.AbstractWriter.write() definition code for javax.swing.text.AbstractWriter.write() ()
          This abstract method needs to be implemented by subclasses.
protected  void write sample code for javax.swing.text.AbstractWriter.write(char) definition code for javax.swing.text.AbstractWriter.write(char) (char ch)
          Writes out a character.
protected  void write sample code for javax.swing.text.AbstractWriter.write(char[], int, int) definition code for javax.swing.text.AbstractWriter.write(char[], int, int) (char[] chars, int startIndex, int length)
          All write methods call into this one.
protected  void write sample code for javax.swing.text.AbstractWriter.write(java.lang.String) definition code for javax.swing.text.AbstractWriter.write(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  content)
          Writes out a string.
protected  void writeAttributes sample code for javax.swing.text.AbstractWriter.writeAttributes(javax.swing.text.AttributeSet) definition code for javax.swing.text.AbstractWriter.writeAttributes(javax.swing.text.AttributeSet) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  attr)
          Writes out the set of attributes as " =" pairs.
protected  void writeLineSeparator sample code for javax.swing.text.AbstractWriter.writeLineSeparator() definition code for javax.swing.text.AbstractWriter.writeLineSeparator() ()
          Writes the line separator.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

NEWLINE sample code for javax.swing.text.AbstractWriter.NEWLINE

protected static final char NEWLINE
How the text packages models newlines.

See Also:
getLineSeparator() sample code for javax.swing.text.AbstractWriter.getLineSeparator() definition code for javax.swing.text.AbstractWriter.getLineSeparator() , Constant Field Values
Constructor Detail

AbstractWriter sample code for javax.swing.text.AbstractWriter(java.io.Writer, javax.swing.text.Document) definition code for javax.swing.text.AbstractWriter(java.io.Writer, javax.swing.text.Document)

protected AbstractWriter(Writer sample code for java.io.Writer definition code for java.io.Writer  w,
                         Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  doc)
Creates a new AbstractWriter. Initializes the ElementIterator with the default root of the document.

Parameters:
w - a Writer.
doc - a Document

AbstractWriter sample code for javax.swing.text.AbstractWriter(java.io.Writer, javax.swing.text.Document, int, int) definition code for javax.swing.text.AbstractWriter(java.io.Writer, javax.swing.text.Document, int, int)

protected AbstractWriter(Writer sample code for java.io.Writer definition code for java.io.Writer  w,
                         Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  doc,
                         int pos,
                         int len)
Creates a new AbstractWriter. Initializes the ElementIterator with the element passed in.

Parameters:
w - a Writer
doc - an Element
pos - The location in the document to fetch the content.
len - The amount to write out.

AbstractWriter sample code for javax.swing.text.AbstractWriter(java.io.Writer, javax.swing.text.Element) definition code for javax.swing.text.AbstractWriter(java.io.Writer, javax.swing.text.Element)

protected AbstractWriter(Writer sample code for java.io.Writer definition code for java.io.Writer  w,
                         Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  root)
Creates a new AbstractWriter. Initializes the ElementIterator with the element passed in.

Parameters:
w - a Writer
root - an Element

AbstractWriter sample code for javax.swing.text.AbstractWriter(java.io.Writer, javax.swing.text.Element, int, int) definition code for javax.swing.text.AbstractWriter(java.io.Writer, javax.swing.text.Element, int, int)

protected AbstractWriter(Writer sample code for java.io.Writer definition code for java.io.Writer  w,
                         Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  root,
                         int pos,
                         int len)
Creates a new AbstractWriter. Initializes the ElementIterator with the element passed in.

Parameters:
w - a Writer
root - an Element
pos - The location in the document to fetch the content.
len - The amount to write out.
Method Detail

getStartOffset sample code for javax.swing.text.AbstractWriter.getStartOffset() definition code for javax.swing.text.AbstractWriter.getStartOffset()

public int getStartOffset()
Returns the first offset to be output.

Since:
1.3

getEndOffset sample code for javax.swing.text.AbstractWriter.getEndOffset() definition code for javax.swing.text.AbstractWriter.getEndOffset()

public int getEndOffset()
Returns the last offset to be output.

Since:
1.3

getElementIterator sample code for javax.swing.text.AbstractWriter.getElementIterator() definition code for javax.swing.text.AbstractWriter.getElementIterator()

protected ElementIterator sample code for javax.swing.text.ElementIterator definition code for javax.swing.text.ElementIterator  getElementIterator()
Fetches the ElementIterator.

Returns:
the ElementIterator.

getWriter sample code for javax.swing.text.AbstractWriter.getWriter() definition code for javax.swing.text.AbstractWriter.getWriter()

protected Writer sample code for java.io.Writer definition code for java.io.Writer  getWriter()
Returns the Writer that is used to output the content.

Since:
1.3

getDocument sample code for javax.swing.text.AbstractWriter.getDocument() definition code for javax.swing.text.AbstractWriter.getDocument()

protected Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  getDocument()
Fetches the document.

Returns:
the Document.

inRange sample code for javax.swing.text.AbstractWriter.inRange(javax.swing.text.Element) definition code for javax.swing.text.AbstractWriter.inRange(javax.swing.text.Element)

protected boolean inRange(Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  next)
This method determines whether the current element is in the range specified. When no range is specified, the range is initialized to be the entire document. inRange() returns true if the range specified intersects with the element's range.

Parameters:
next - an Element.
Returns:
boolean that indicates whether the element is in the range.

write sample code for javax.swing.text.AbstractWriter.write() definition code for javax.swing.text.AbstractWriter.write()

protected abstract void write()
                       throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                              BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException 
This abstract method needs to be implemented by subclasses. Its responsibility is to iterate over the elements and use the write() methods to generate output in the desired format.

Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException
BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException

getText sample code for javax.swing.text.AbstractWriter.getText(javax.swing.text.Element) definition code for javax.swing.text.AbstractWriter.getText(javax.swing.text.Element)

protected String sample code for java.lang.String definition code for java.lang.String  getText(Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  elem)
                  throws BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException 
Returns the text associated with the element. The assumption here is that the element is a leaf element. Throws a BadLocationException when encountered.

Parameters:
elem - an Element
Returns:
the text as a String
Throws:
BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException - if pos represents an invalid location within the document

text sample code for javax.swing.text.AbstractWriter.text(javax.swing.text.Element) definition code for javax.swing.text.AbstractWriter.text(javax.swing.text.Element)

protected void text(Element sample code for javax.swing.text.Element definition code for javax.swing.text.Element  elem)
             throws BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException ,
                    IOException sample code for java.io.IOException definition code for java.io.IOException 
Writes out text. If a range is specified when the constructor is invoked, then only the appropriate range of text is written out.

Parameters:
elem - an Element.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - on any I/O error
BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException - if pos represents an invalid location within the document.

setLineLength sample code for javax.swing.text.AbstractWriter.setLineLength(int) definition code for javax.swing.text.AbstractWriter.setLineLength(int)

protected void setLineLength(int l)
Enables subclasses to set the number of characters they want written per line. The default is 100.

Parameters:
l - the maximum line length.

getLineLength sample code for javax.swing.text.AbstractWriter.getLineLength() definition code for javax.swing.text.AbstractWriter.getLineLength()

protected int getLineLength()
Returns the maximum line length.

Since:
1.3

setCurrentLineLength sample code for javax.swing.text.AbstractWriter.setCurrentLineLength(int) definition code for javax.swing.text.AbstractWriter.setCurrentLineLength(int)

protected void setCurrentLineLength(int length)
Sets the current line length.

Since:
1.3.

getCurrentLineLength sample code for javax.swing.text.AbstractWriter.getCurrentLineLength() definition code for javax.swing.text.AbstractWriter.getCurrentLineLength()

protected int getCurrentLineLength()
Returns the current line length.

Since:
1.3.

isLineEmpty sample code for javax.swing.text.AbstractWriter.isLineEmpty() definition code for javax.swing.text.AbstractWriter.isLineEmpty()

protected boolean isLineEmpty()
Returns true if the current line should be considered empty. This is true when getCurrentLineLength == 0 || indent has been invoked on an empty line.

Since:
1.3

setCanWrapLines sample code for javax.swing.text.AbstractWriter.setCanWrapLines(boolean) definition code for javax.swing.text.AbstractWriter.setCanWrapLines(boolean)

protected void setCanWrapLines(boolean newValue)
Sets whether or not lines can be wrapped. This can be toggled during the writing of lines. For example, outputting HTML might set this to false when outputting a quoted string.

Since:
1.3

getCanWrapLines sample code for javax.swing.text.AbstractWriter.getCanWrapLines() definition code for javax.swing.text.AbstractWriter.getCanWrapLines()

protected boolean getCanWrapLines()
Returns whether or not the lines can be wrapped. If this is false no lineSeparator's will be output.

Since:
1.3

setIndentSpace sample code for javax.swing.text.AbstractWriter.setIndentSpace(int) definition code for javax.swing.text.AbstractWriter.setIndentSpace(int)

protected void setIndentSpace(int space)
Enables subclasses to specify how many spaces an indent maps to. When indentation takes place, the indent level is multiplied by this mapping. The default is 2.

Parameters:
space - an int representing the space to indent mapping.

getIndentSpace sample code for javax.swing.text.AbstractWriter.getIndentSpace() definition code for javax.swing.text.AbstractWriter.getIndentSpace()

protected int getIndentSpace()
Returns the amount of space to indent.

Since:
1.3

setLineSeparator sample code for javax.swing.text.AbstractWriter.setLineSeparator(java.lang.String) definition code for javax.swing.text.AbstractWriter.setLineSeparator(java.lang.String)

public void setLineSeparator(String sample code for java.lang.String definition code for java.lang.String  value)
Sets the String used to reprsent newlines. This is initialized in the constructor from either the Document, or the System property line.separator.

Since:
1.3

getLineSeparator sample code for javax.swing.text.AbstractWriter.getLineSeparator() definition code for javax.swing.text.AbstractWriter.getLineSeparator()

public String sample code for java.lang.String definition code for java.lang.String  getLineSeparator()
Returns the string used to represent newlines.

Since:
1.3

incrIndent sample code for javax.swing.text.AbstractWriter.incrIndent() definition code for javax.swing.text.AbstractWriter.incrIndent()

protected void incrIndent()
Increments the indent level. If indenting would cause getIndentSpace() *getIndentLevel() to be > than getLineLength() this will not cause an indent.


decrIndent sample code for javax.swing.text.AbstractWriter.decrIndent() definition code for javax.swing.text.AbstractWriter.decrIndent()

protected void decrIndent()
Decrements the indent level.


getIndentLevel sample code for javax.swing.text.AbstractWriter.getIndentLevel() definition code for javax.swing.text.AbstractWriter.getIndentLevel()

protected int getIndentLevel()
Returns the current indentation level. That is, the number of times incrIndent has been invoked minus the number of times decrIndent has been invoked.

Since:
1.3

indent sample code for javax.swing.text.AbstractWriter.indent() definition code for javax.swing.text.AbstractWriter.indent()

protected void indent()
               throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Does indentation. The number of spaces written out is indent level times the space to map mapping. If the current line is empty, this will not make it so that the current line is still considered empty.

Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - on any I/O error

write sample code for javax.swing.text.AbstractWriter.write(char) definition code for javax.swing.text.AbstractWriter.write(char)

protected void write(char ch)
              throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Writes out a character. This is implemented to invoke the write method that takes a char[].

Parameters:
ch - a char.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - on any I/O error

write sample code for javax.swing.text.AbstractWriter.write(java.lang.String) definition code for javax.swing.text.AbstractWriter.write(java.lang.String)

protected void write(String sample code for java.lang.String definition code for java.lang.String  content)
              throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Writes out a string. This is implemented to invoke the write method that takes a char[].

Parameters:
content - a String.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - on any I/O error

writeLineSeparator sample code for javax.swing.text.AbstractWriter.writeLineSeparator() definition code for javax.swing.text.AbstractWriter.writeLineSeparator()

protected void writeLineSeparator()
                           throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Writes the line separator. This invokes output directly as well as setting the lineLength to 0.

Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException
Since:
1.3

write sample code for javax.swing.text.AbstractWriter.write(char[], int, int) definition code for javax.swing.text.AbstractWriter.write(char[], int, int)

protected void write(char[] chars,
                     int startIndex,
                     int length)
              throws IOException sample code for java.io.IOException definition code for java.io.IOException 
All write methods call into this one. If getCanWrapLines() returns false, this will call output with each sequence of chars that doesn't contain a NEWLINE, followed by a call to writeLineSeparator. On the other hand, if getCanWrapLines() returns true, this will split the string, as necessary, so getLineLength is honored. The only exception is if the current string contains no whitespace, and won't fit in which case the line length will exceed getLineLength.

Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException
Since:
1.3

writeAttributes sample code for javax.swing.text.AbstractWriter.writeAttributes(javax.swing.text.AttributeSet) definition code for javax.swing.text.AbstractWriter.writeAttributes(javax.swing.text.AttributeSet)

protected void writeAttributes(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  attr)
                        throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Writes out the set of attributes as " =" pairs. It throws an IOException when encountered.

Parameters:
attr - an AttributeSet.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - on any I/O error

output sample code for javax.swing.text.AbstractWriter.output(char[], int, int) definition code for javax.swing.text.AbstractWriter.output(char[], int, int)

protected void output(char[] content,
                      int start,
                      int length)
               throws IOException sample code for java.io.IOException definition code for java.io.IOException 
The last stop in writing out content. All the write methods eventually make it to this method, which invokes write on the Writer.

This method also updates the line length based on length. If this is invoked to output a newline, the current line length will need to be reset as will no longer be valid. If it is up to the caller to do this. Use writeLineSeparator to write out a newline, which will property update the current line length.

Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException
Since:
1.3