de.betabeans.scroogexhtml.dom
Class Paragraph

java.lang.Object
  extended by de.betabeans.scroogexhtml.dom.Paragraph
All Implemented Interfaces:
DocumentNode, java.io.Serializable

public final class Paragraph
extends java.lang.Object
implements DocumentNode, java.io.Serializable

ScroogeXHTML creates a Paragraph object for each paragraph of the document. A Paragraph object stores the paragraph properties and a sequence of text objects.

Author:
Michael Justin
See Also:
Document, FormattedText, Serialized Form

Constructor Summary
Paragraph(Document adocument)
          Constructor for the Paragraph object.
 
Method Summary
 void add(char c)
          Add a character to the last text object in the paragraph.
 void add(java.lang.String text)
          Add a String to the last text object.
protected  Document getDocument()
          Gets the document attribute.
 ParagraphProperties getPp()
          Returns the ParagraphProperties value.
 FormattedText getText()
          Get the current text object (create one if necessary).
 boolean isEmpty()
           
 FormattedText nextText()
          Add and return a new empty text element, recycle empty text buffer.
protected  void setParProperties(ParagraphProperties app)
          Sets the paragraph properties.
 java.lang.String toPlainText()
          Convert the paragraph text to plain text.
 java.lang.String toString()
          Convert the paragraph text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Paragraph

public Paragraph(Document adocument)
Constructor for the Paragraph object.

Parameters:
adocument - The owner (DOM document) of the paragraph.
Method Detail

setParProperties

protected void setParProperties(ParagraphProperties app)
Sets the paragraph properties.

Parameters:
app - The new parProperties value

getText

public FormattedText getText()
Get the current text object (create one if necessary).

Returns:
The text value

getDocument

protected Document getDocument()
Gets the document attribute.

Returns:
The document value

toString

public java.lang.String toString()
Convert the paragraph text.

Specified by:
toString in interface DocumentNode
Overrides:
toString in class java.lang.Object
Returns:
text

toPlainText

public java.lang.String toPlainText()
Convert the paragraph text to plain text.

Returns:
text

add

public void add(java.lang.String text)
Add a String to the last text object.

Specified by:
add in interface DocumentNode
Parameters:
text - String to be added

add

public void add(char c)
Add a character to the last text object in the paragraph.

Specified by:
add in interface DocumentNode
Parameters:
c - character to be added

nextText

public FormattedText nextText()
Add and return a new empty text element, recycle empty text buffer.

Returns:
a text element

getPp

public ParagraphProperties getPp()
Returns the ParagraphProperties value.

Returns:
ParagraphProperties

isEmpty

public boolean isEmpty()


Copyright (c) 1998-2006 BetaSoft Michael Justin. All Rights Reserved.