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.
  • 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