Class ContentItem
java.lang.Object
com.aquima.interactions.composer.model.Element
com.aquima.interactions.composer.model.CompositeElement
com.aquima.interactions.composer.model.ContentItem
- All Implemented Interfaces:
ICompositeElement
,IContentItem
,IElement
,Serializable
The content model represents a content node that needs to be displayed in the document.
- Since:
- 6.0
- Author:
- O. Kerpershoek
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ContentItem
(ContentItem other, boolean duplicateContents) ContentItem
(String name, String description, ContentStyle contentStyle, Element[] elements) Constructs a content item with a name, contentStyle and content.ContentItem
(String name, String description, ContentStyle contentStyle, PresentationStyle[] presentationStyles) Constructs a content item with a name, contentStyle and presentation style. -
Method Summary
Modifier and TypeMethodDescriptionThis method should clone the element and return the cloned element.boolean
This method returns the description of the content item.String[]
Returns the language codes used in this content item.getPlainText
(String defaultLanguageCode, IValueFormatter formatter) Returns the plain text content of this content item in all available languages.getPlainText
(String languageCode, String defaultLanguageCode, IValueFormatter formatter) Returns the plain text content of this content item in the given language.int
hashCode()
toString()
Methods inherited from class com.aquima.interactions.composer.model.CompositeElement
accept, addElement, addElements, equalsContent, getContentStyle, getElement, getElement, getElementCount, getElements, insertElement, removeAllElements, removeElement, replaceElementWithElements, setContentStyle, setElements
Methods inherited from class com.aquima.interactions.composer.model.Element
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.ICompositeElement
accept, equalsContent, getContentStyle, getElement, getElement, getElementCount, getElements
Methods inherited from interface com.aquima.interactions.composer.IElement
getName, getParent, getPresentationStyles, getProperty, getPropertyKeys, getRuntimeKey, hasFocus, hasPresentationStyle, isReadonly, isReadonlyInheritFromParent, isVisible, setProperty
-
Constructor Details
-
ContentItem
public ContentItem(String name, String description, ContentStyle contentStyle, PresentationStyle[] presentationStyles) Constructs a content item with a name, contentStyle and presentation style. this constructor is public to allow test case access.- Parameters:
name
- The name of the content item.description
- The optional description of the content item.contentStyle
- The content style of the content item (may be null)presentationStyles
- The presentation styles of the content item.
-
ContentItem
Constructs a content item with a name, contentStyle and content. this constructor is public to allow test case access.- Parameters:
name
- The name of the content item.description
- The optional display name of the content item.contentStyle
- The content style of the content item.elements
- The content of the content item (may be null)
-
ContentItem
-
-
Method Details
-
getDescription
Description copied from interface:IContentItem
This method returns the description of the content item.- Specified by:
getDescription
in interfaceIContentItem
- Returns:
- the description of the content item, may be null.
-
equals
- Overrides:
equals
in classCompositeElement
-
hashCode
public int hashCode()- Overrides:
hashCode
in classCompositeElement
-
toString
- Overrides:
toString
in classCompositeElement
-
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. -
getLanguageCodes
Description copied from interface:IContentItem
Returns the language codes used in this content item.- Specified by:
getLanguageCodes
in interfaceIContentItem
- Returns:
- array with unique language codes, may be empty but never null.
-
getPlainText
public String getPlainText(String languageCode, String defaultLanguageCode, IValueFormatter formatter) Description copied from interface:IContentItem
Returns the plain text content of this content item in the given language.- Specified by:
getPlainText
in interfaceIContentItem
- 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 content item.
-
getPlainText
Description copied from interface:IContentItem
Returns the plain text content of this content item in all available languages.- Specified by:
getPlainText
in interfaceIContentItem
- 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 content item
-