Package com.independentsoft.office.odf.fields

# Class ConditionalText

java.lang.Object
com.independentsoft.office.odf.fields.Field
com.independentsoft.office.odf.fields.ConditionalText

All Implemented Interfaces:
  `IContentElement`, `IParagraphContent`

public class ConditionalText extends Field
Represents a condition for display of one text string or another.

- ## Field Summary

  ### Fields inherited from class com.independentsoft.office.odf.fields.Field

  `parent`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConditionalText()`
  Initializes a new instance of the ConditionalText class.
  `ConditionalText​(InternalXMLStreamReader reader)`
  Instantiates a new conditional text.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ConditionalText`
  `clone()`
  Creates a new object that is a deep copy of the current instance.
  `String`
  `getCondition()`
  Gets the condition that determines which of the two text strings.
  `List<IContentElement>`
  `getContentElements()`
  Returns all content elements.
  `IContentElement`
  `getParent()`
  Returns the parent content element.
  `String`
  `getValue()`
  Gets the conditional text.
  `String`
  `getValueIfFalse()`
  Gets a text String to display if a condition is false.
  `String`
  `getValueIfTrue()`
  Gets a text string to display if a condition is true.
  `boolean`
  `isCurrentValue()`
  Gets the evaluation result of a condition given by the expression.
  `void`
  `setCondition​(String value)`
  Sets the condition that determines which of the two text strings.
  `void`
  `setCurrentValue​(boolean isCurrentValue)`
  Sets the evaluation result of a condition given by the expression.
  `void`
  `setParent​(IContentElement parent)`
  Sets the parent content element.
  `void`
  `setValue​(String value)`
  Sets the conditional text.
  `void`
  `setValueIfFalse​(String valueIfFalse)`
  Sets a text String to display if a condition is false.
  `void`
  `setValueIfTrue​(String valueIfTrue)`
  Sets a text string to display if a condition is true.
  `String`
  `toString()`
  Converts the value of the current ConditionalText object to its equivalent string representation.

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

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

- ## Constructor Details

  - ### ConditionalText

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

  - ### ConditionalText

    public ConditionalText​(InternalXMLStreamReader reader) throws XMLStreamException
    Instantiates a new conditional text.
    Parameters:
      `reader` - the reader
    Throws:
      `XMLStreamException` - the xML stream exception

- ## Method Details

  - ### getContentElements

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

  - ### getParent

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

  - ### setParent

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

  - ### clone

    public ConditionalText 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`
    Specified by:
      `clone` in class `Field`
    Returns:
      A new object that is a copy of this instance.

  - ### toString

    public String toString()
    Converts the value of the current ConditionalText object to its equivalent string representation.
    Overrides:
      `toString` in class `Object`
    Returns:
      the string

  - ### getCondition

    public String getCondition()
    Gets the condition that determines which of the two text strings.
    Returns:
      the condition

  - ### setCondition

    public void setCondition​(String value)
    Sets the condition that determines which of the two text strings.
    Parameters:
      `value` - the new condition

  - ### getValueIfTrue

    public String getValueIfTrue()
    Gets a text string to display if a condition is true.
    Returns:
      the value if true

  - ### setValueIfTrue

    public void setValueIfTrue​(String valueIfTrue)
    Sets a text string to display if a condition is true.
    Parameters:
      `valueIfTrue` - the new value if true

  - ### getValueIfFalse

    public String getValueIfFalse()
    Gets a text String to display if a condition is false.
    Returns:
      the value if false

  - ### setValueIfFalse

    public void setValueIfFalse​(String valueIfFalse)
    Sets a text String to display if a condition is false.
    Parameters:
      `valueIfFalse` - the new value if false

  - ### isCurrentValue

    public boolean isCurrentValue()
    Gets the evaluation result of a condition given by the expression.
    Returns:
      true, if is current value

  - ### setCurrentValue

    public void setCurrentValue​(boolean isCurrentValue)
    Sets the evaluation result of a condition given by the expression.
    Parameters:
      `isCurrentValue` - the new current value

  - ### getValue

    public String getValue()
    Gets the conditional text.
    Returns:
      the value

  - ### setValue

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