Package com.independentsoft.office.odf

# Class Text

java.lang.Object
com.independentsoft.office.odf.Text

All Implemented Interfaces:
  `IContentElement`, `IParagraphContent`

public class Text extends Object implements IParagraphContent
Represents text in headings and paragraphs.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Text()`
  Initializes a new instance of the Text class.
  `Text​(String text)`
  Initializes a new instance of the Text class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Text`
  `clone()`
  Creates a new object that is a deep copy of the current instance.
  `List<IContentElement>`
  `getContentElements()`
  Returns all content elements.
  `IContentElement`
  `getParent()`
  Returns the parent content element.
  `String`
  `getValue()`
  Gets the content.
  `void`
  `setParent​(IContentElement parent)`
  Sets the parent content element.
  `void`
  `setValue​(String text)`
  Sets the content.
  `String`
  `toString()`
  Converts the value of the current Text object to its equivalent string representation.

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Text

    public Text()
    Initializes a new instance of the Text class.

  - ### Text

    public Text​(String text)
    Initializes a new instance of the Text class.
    Parameters:
      `text` - the text

- ## Method Details

  - ### getContentElements

    public List<IContentElement> getContentElements()
    Returns all content elements.
    Specified by:
      `getContentElements` in interface `IContentElement`
    Returns:
      A collection of content elements.

  - ### getParent

    public IContentElement getParent()
    Returns the parent content element.
    Specified by:
      `getParent` in interface `IContentElement`
    Returns:
      the parent

  - ### setParent

    public void setParent​(IContentElement parent)
    Sets the parent content element.
    Specified by:
      `setParent` in interface `IContentElement`
    Parameters:
      `parent` - the new parent

  - ### clone

    public Text clone()
    Creates a new object that is a deep copy of the current instance.
    Specified by:
      `clone` in interface `IContentElement`
    Specified by:
      `clone` in interface `IParagraphContent`
    Overrides:
      `clone` in class `Object`
    Returns:
      A new object that is a copy of this instance.

  - ### toString

    public String toString()
    Converts the value of the current Text object to its equivalent string representation. Runs of spaces are encoded with the text:s element as required by the OpenDocument specification, because consumers collapse literal space sequences. Use the Tab and LineBreak classes for explicit tab stops and line breaks.
    Overrides:
      `toString` in class `Object`
    Returns:
      the string

  - ### getValue

    public String getValue()
    Gets the content.
    Returns:
      the value

  - ### setValue

    public void setValue​(String text)
    Sets the content.
    Parameters:
      `text` - the new value