PACKAGE
PREV CLASS
CLASS
NEXT CLASS
USE
TREE
FRAMES
DEPRECATED
INDEX
NO FRAMES
HELP
Java Platform
Standard Ed. 8
ALL CLASSES
javax.swing.text
Class AbstractWriter
java.lang.Object
javax.swing.text.AbstractWriter
Direct Known Subclasses:
HTMLWriter, MinimalHTMLWriter
Field Summary
Fields
Modifier and Type
Constructor Summary
Constructors
Modifier
protected
protected
protected
protected
Method Summary
All Methods
Instance Methods
Abstract Methods
protected void
decrIndent()
Concrete Methods
getCanWrapLines()
Returns whether or not the lines can be wrapped.
protected int
getCurrentLineLength()
Returns the current line length.
protected Document
getDocument()
Fetches the document.
getEndOffset()
Returns the last offset to be output.
protected int
getIndentLevel()
Returns the current indentation level.
protected int
getIndentSpace()
Returns the amount of space to indent.
protected int
getLineLength()
Returns the maximum line length.
String
getLineSeparator()
Returns the string used to represent newlines.
int
getStartOffset()
Returns the first offset to be output.
protected String
getText(Element elem)
Returns the text associated with the element.
protected Writer
getWriter()
Returns the Writer that is used to output the content.
protected void
incrIndent()
Increments the indent level.
protected void
indent()
Does indentation.
protected boolean
inRange(Element next)
This method determines whether the current element is
in the range specified.
protected boolean
isLineEmpty()
Returns true if the current line should be considered
empty.
protected void
protected void
setCanWrapLines(boolean newValue)
Sets whether or not lines can be wrapped.
protected void
setCurrentLineLength(int length)
Sets the current line length.
protected void
setIndentSpace(int space)
Enables subclasses to specify how many spaces an
indent maps to.
protected void
setLineLength(int l)
Enables subclasses to set the number of characters they
want written per line.
void
setLineSeparator(String value)
Sets the String used to represent newlines.
protected void
text(Element elem)
Writes out text.
write()
This abstract method needs to be implemented by
subclasses.
protected void
write(char ch)
Writes out a character.
protected void
protected void
write(String content)
Writes out a string.
protected void
writeAttributes(AttributeSet attr)
Writes out the set of attributes as " <name>=<value>"
pairs.
protected void
writeLineSeparator()
Writes the line separator.
Field Detail
NEWLINE
Constructor Detail
AbstractWriter
protected AbstractWriter(Writer w,
Document doc)
Creates a new AbstractWriter. Initializes the ElementIterator with the default root of
the document.
Parameters:
w - a Writer.
doc - a Document
AbstractWriter
protected AbstractWriter(Writer w,
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
protected AbstractWriter(Writer w,
Element root)
Creates a new AbstractWriter. Initializes the ElementIterator with the element passed
in.
Parameters:
w - a Writer
root - an Element
AbstractWriter
protected AbstractWriter(Writer w,
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
1.3
getEndOffset
1.3
getElementIterator
the ElementIterator.
getWriter
1.3
getDocument
the Document.
inRange
next - an Element.
Returns:
write
IOException
BadLocationException
getText
elem - an Element
Returns:
text
Parameters:
elem - an Element.
Throws:
setLineLength
getLineLength
1.3
setCurrentLineLength
1.3
getCurrentLineLength
1.3
isLineEmpty
1.3
setCanWrapLines
1.3
getCanWrapLines
1.3
setIndentSpace
getIndentSpace
Since:
1.3
setLineSeparator
1.3
getLineSeparator
1.3
incrIndent
1.3
indent
write
ch - a char.
Throws:
write
content - a String.
Throws:
writeLineSeparator
IOException
Since:
1.3
write
IOException
Since:
1.3
writeAttributes
attr - an AttributeSet.
Throws:
output
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
Since:
1.3
OVERVIEW
PACKAGE
PREV CLASS
CLASS
NEXT CLASS
USE
TREE
FRAMES
DEPRECATED
NO FRAMES
INDEX
HELP
Java Platform
Standard Ed. 8
ALL CLASSES