Class ConditionalText
java.lang.Object
com.independentsoft.office.odf.fields.Field
com.independentsoft.office.odf.fields.ConditionalText
- All Implemented Interfaces:
IContentElement,IParagraphContent
Represents a condition for display of one text string or another.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance of the ConditionalText class.ConditionalText(InternalXMLStreamReader reader)Instantiates a new conditional text. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a new object that is a deep copy of the current instance.Gets the condition that determines which of the two text strings.Returns all content elements.Returns the parent content element.getValue()Gets the conditional text.Gets a text String to display if a condition is false.Gets a text string to display if a condition is true.booleanGets the evaluation result of a condition given by the expression.voidsetCondition(String value)Sets the condition that determines which of the two text strings.voidsetCurrentValue(boolean isCurrentValue)Sets the evaluation result of a condition given by the expression.voidsetParent(IContentElement parent)Sets the parent content element.voidSets the conditional text.voidsetValueIfFalse(String valueIfFalse)Sets a text String to display if a condition is false.voidsetValueIfTrue(String valueIfTrue)Sets a text string to display if a condition is true.toString()Converts the value of the current ConditionalText object to its equivalent string representation.
-
Constructor Details
-
ConditionalText
public ConditionalText()Initializes a new instance of the ConditionalText class. -
ConditionalText
Instantiates a new conditional text.- Parameters:
reader- the reader- Throws:
XMLStreamException- the xML stream exception
-
-
Method Details
-
getContentElements
Returns all content elements.- Specified by:
getContentElementsin interfaceIContentElement- Specified by:
getContentElementsin classField- Returns:
- A collection of content elements.
-
getParent
Returns the parent content element.- Specified by:
getParentin interfaceIContentElement- Overrides:
getParentin classField- Returns:
- the parent
-
setParent
Sets the parent content element.- Specified by:
setParentin interfaceIContentElement- Overrides:
setParentin classField- Parameters:
parent- the new parent
-
clone
Creates a new object that is a deep copy of the current instance.- Specified by:
clonein interfaceIContentElement- Specified by:
clonein interfaceIParagraphContent- Specified by:
clonein classField- Returns:
- A new object that is a copy of this instance.
-
toString
Converts the value of the current ConditionalText object to its equivalent string representation. -
getCondition
Gets the condition that determines which of the two text strings.- Returns:
- the condition
-
setCondition
Sets the condition that determines which of the two text strings.- Parameters:
value- the new condition
-
getValueIfTrue
Gets a text string to display if a condition is true.- Returns:
- the value if true
-
setValueIfTrue
Sets a text string to display if a condition is true.- Parameters:
valueIfTrue- the new value if true
-
getValueIfFalse
Gets a text String to display if a condition is false.- Returns:
- the value if false
-
setValueIfFalse
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
Gets the conditional text.- Returns:
- the value
-
setValue
Sets the conditional text.- Parameters:
value- the new value
-