Class TextItem
java.lang.Object
com.aquima.interactions.composer.model.Element
com.aquima.interactions.composer.model.TextItem
- All Implemented Interfaces:
IElement
,ITextItem
,ICompositeTextNode
,Serializable
The multilingual text model represents a text node that needs to be displayed in the document or page.
- Since:
- 6.0
- Author:
- O. Kerpershoek
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNode
(TextElement element, String languageCode) This method will add the text element to the composite node for a specific language.This method should clone the element and return the cloned element.boolean
String[]
Returns the set language codes.This method returns all the text elements from this text model for a specific language.getPlainText
(String defaultLanguageCode, IValueFormatter formatter) Returns the plain text content of this text item in all available languages.getPlainText
(String languageCode, String defaultLanguageCode, IValueFormatter formatter) Returns the plain text content of this text item in the given language.int
hashCode()
toString()
Methods inherited from class com.aquima.interactions.composer.model.Element
accept, addPresentationStyle, evaluateTsl, getName, getParent, getPresentationStyles, getProperty, getPropertyKeys, getRuntimeKey, getVisibilityCondition, hasFocus, hasPresentationStyle, isReadonly, isReadonlyInheritFromParent, isVisible, setFocus, setParent, setPresentationStyle, setPresentationStyles, setPresentationStyles, setProperty, setReadonly, setReadonlyInheritFromParent, setRuntimeKey, setVisibilityCondition, setVisible
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.aquima.interactions.composer.IElement
accept, getName, getParent, getPresentationStyles, getProperty, getPropertyKeys, getRuntimeKey, hasFocus, hasPresentationStyle, isReadonly, isReadonlyInheritFromParent, isVisible, setProperty
-
Constructor Details
-
TextItem
Construct a text model. this constructor is public to allow test case access.- Parameters:
name
- The name of the text model, mandatory.
-
TextItem
Copy constructor.- Parameters:
other
- The text item that should be used to copy the data from.duplicateContents
- Boolean indicating if the contents should be duplicated.
-
-
Method Details
-
duplicate
Description copied from interface:IElement
This method should clone the element and return the cloned element. The duplicate method should usually make a deep copy of the element, with the exception of members that are not mutable (and thus can safely be shared between multiple copies). The properties of an element are considered to be non-mutable, and will thus by default be copied. -
addNode
Description copied from interface:ICompositeTextNode
This method will add the text element to the composite node for a specific language.- Specified by:
addNode
in interfaceICompositeTextNode
- Parameters:
element
- The text element that needs to be added.languageCode
- The language code for which the element is added.
-
getNodes
This method returns all the text elements from this text model for a specific language. -
equals
-
hashCode
public int hashCode() -
toString
-
getLanguageCodes
Description copied from interface:ITextItem
Returns the set language codes.- Specified by:
getLanguageCodes
in interfaceITextItem
- Returns:
- The language codes, not null.
-
getPlainText
public String getPlainText(String languageCode, String defaultLanguageCode, IValueFormatter formatter) Description copied from interface:ITextItem
Returns the plain text content of this text item in the given language.- Specified by:
getPlainText
in interfaceITextItem
- Parameters:
languageCode
- the language in which the plain text should be returned (not null)defaultLanguageCode
- the default language to use (not null)formatter
- the formatter used to format value nodes (not null)- Returns:
- the plain text of this text item.
-
getPlainText
Description copied from interface:ITextItem
Returns the plain text content of this text item in all available languages.- Specified by:
getPlainText
in interfaceITextItem
- Parameters:
defaultLanguageCode
- the default language to use (not null)formatter
- the formatter used to format value nodes (not null)- Returns:
- the plain text of this text item
-