org.jopendocument.dom.text
Class TextNode<S extends StyleStyle>

java.lang.Object
  extended by org.jopendocument.dom.ODNode
      extended by org.jopendocument.dom.StyledNode<S,TextDocument>
          extended by org.jopendocument.dom.text.TextNode<S>
Type Parameters:
S - type of style.
Direct Known Subclasses:
Paragraph

public abstract class TextNode<S extends StyleStyle>
extends StyledNode<S,TextDocument>

A text node that can be created ex nihilo. Ie without a document at first.

Author:
Sylvain CUAZ

Constructor Summary
TextNode(org.jdom.Element local, java.lang.Class<S> styleClass)
           
 
Method Summary
 java.lang.String getCharacterContent()
           
 java.lang.String getCharacterContent(boolean ooMode)
           
static java.lang.String getCharacterContent(org.jdom.Element pElem, XMLFormatVersion vers, boolean ooMode)
          Return the text value of the passed element.
static java.lang.String getChildrenCharacterContent(org.jdom.Element parentElem, XMLFormatVersion vers, boolean ooMode)
           
 TextDocument getODDocument()
           
 void setDocument(TextDocument doc)
           
 
Methods inherited from class org.jopendocument.dom.StyledNode
getPrivateStyle, getStyle, getStyleDesc, getStyleDesc, getStyleStyleDesc, setStyleName, setStyleName
 
Methods inherited from class org.jopendocument.dom.ODNode
getElement, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextNode

public TextNode(org.jdom.Element local,
                java.lang.Class<S> styleClass)
Method Detail

getChildrenCharacterContent

public static java.lang.String getChildrenCharacterContent(org.jdom.Element parentElem,
                                                           XMLFormatVersion vers,
                                                           boolean ooMode)

getCharacterContent

public static final java.lang.String getCharacterContent(org.jdom.Element pElem,
                                                         XMLFormatVersion vers,
                                                         boolean ooMode)
Return the text value of the passed element. This method doesn't just return the XML text content, it also parses XML elements (like paragraphs, tabs and line-breaks). For the differences between the OO way (as of 3.1) and the OpenDocument way see section 5.1.1 White-space Characters of OpenDocument-v1.0-os and ยง6.1.2 of OpenDocument-v1.2-part1. In essence OpenOffice never trim strings.

Parameters:
pElem - a text element, e.g. text:p or text:h.
vers - the version of the element.
ooMode - whether to use the OO way or the standard way.
Returns:
the parsed text value.

getODDocument

public final TextDocument getODDocument()
Specified by:
getODDocument in class StyledNode<S extends StyleStyle,TextDocument>

setDocument

public final void setDocument(TextDocument doc)

getCharacterContent

public final java.lang.String getCharacterContent()

getCharacterContent

public final java.lang.String getCharacterContent(boolean ooMode)