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

Field Summary
protected  TextDocument parent
           
 
Constructor Summary
  TextNode(org.jdom.Element local, Class<S> styleClass)
           
protected TextNode(org.jdom.Element local, Class<S> styleClass, TextDocument parent)
           
 
Method Summary
protected abstract  void checkDocument(ODDocument doc)
           
 String getCharacterContent()
           
 String getCharacterContent(boolean ooMode)
           
static String getCharacterContent(org.jdom.Element pElem, XMLFormatVersion vers, boolean ooMode)
          Return the text value of the passed element.
static 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, getStyle, getStyle, getStyle, getStyleDesc, getStyleDesc, getStyleDesc, getStyleName, getStyleStyleDesc, setStyleName, setStyleName
 
Methods inherited from class org.jopendocument.dom.ODNode
getElement, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected TextDocument parent
Constructor Detail

TextNode

public TextNode(org.jdom.Element local,
                Class<S> styleClass)

TextNode

protected TextNode(org.jdom.Element local,
                   Class<S> styleClass,
                   TextDocument parent)
Method Detail

getChildrenCharacterContent

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

getCharacterContent

public static final 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)

checkDocument

protected abstract void checkDocument(ODDocument doc)

getCharacterContent

public final String getCharacterContent()

getCharacterContent

public final String getCharacterContent(boolean ooMode)


Copyright © 2010 jOpenDocument All Rights Reserved.