java.lang.Object
com.aquima.interactions.composer.model.Element
All Implemented Interfaces:
IElement, Serializable
Direct Known Subclasses:
Asset, Button, CompositeElement, Field, HiddenElement, Image, InstanceListOrder, Link, TextItem

public abstract class Element extends Object implements IElement
Base class for all runtime page elements.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Field Details

    • name

      protected String name
  • Constructor Details

    • Element

      protected Element(String name)
      Constructs a runtime element for the specified name.
      Parameters:
      name - The name of the runtime element (mandatory)
    • Element

      protected Element(Element other)
    • Element

      protected Element(ElementDefinition definition)
  • Method Details

    • evaluateTsl

      protected static IMultilingualText evaluateTsl(InferenceContext context, IDynamicText displayText)
    • getParent

      public ICompositeElement getParent()
      Description copied from interface: IElement
      This method returns the parent container the element is contained in, or null if the element is not assigned to a container.
      Specified by:
      getParent in interface IElement
      Returns:
      The parent container of the element.
    • setParent

      protected void setParent(ICompositeElement parent)
    • getRuntimeKey

      public RuntimeKey getRuntimeKey()
      Description copied from interface: IElement
      This method will return the unique identifier of the element within a page. An element with the same name may be included multiple times on the same page, but each instance is assigned it's own unique runtime key do distinguish between the elements.
      Note: Elements get a runtime key assigned during the final evaluation of a page. When an element is created outside a page, or during the creation of the page, the runtime key will still be unknown.
      Specified by:
      getRuntimeKey in interface IElement
      Returns:
      The unique runtime key of the element within a page.
    • setRuntimeKey

      public void setRuntimeKey(RuntimeKey key)
    • getName

      public String getName()
      Description copied from interface: IElement
      This method returns the name of the element. This name corresponds to the name of the element definition the element is based upon.
      Specified by:
      getName in interface IElement
      Returns:
      The name of the element (not null)
    • getPresentationStyles

      public PresentationStyle[] getPresentationStyles()
      Description copied from interface: IElement
      This method will return the styles that should be used when rendering the element. The styles is an optional parameter, and as such the styles may not have been set (empty array value).
      Specified by:
      getPresentationStyles in interface IElement
      Returns:
      The styles information of the element, never null, but could be an empty array.
    • setPresentationStyles

      public Element setPresentationStyles(String[] styles)
      This method can be used to override the style of the runtime element. The style of an element is optional, so this method may also be used to clear any existing style information by invoking this method with a null value.
      Parameters:
      styles - The new style information for the element.
      Returns:
      Pointer to this element to allow method chaining.
    • setPresentationStyles

      public Element setPresentationStyles(PresentationStyle[] styles)
      This method can be used to override the style of the runtime element. The style of an element is optional, so this method may also be used to clear any existing style information by invoking this method with a null value.
      Parameters:
      styles - The new style information for the element.
      Returns:
      Pointer to this element to allow method chaining.
    • hasPresentationStyle

      public boolean hasPresentationStyle(PresentationStyle style)
      Description copied from interface: IElement
      This method will return true if the PresentationStyle is present on this element.
      Specified by:
      hasPresentationStyle in interface IElement
      Parameters:
      style - The PresentationStyle to find
      Returns:
      True if the presentationStyle was present, false otherwise.
    • addPresentationStyle

      public Element addPresentationStyle(PresentationStyle style)
      This method can be used to add a the style to the runtime element.
      Parameters:
      style - The new style information to the element, must not be null.
      Returns:
      Pointer to this element to allow method chaining.
    • setPresentationStyle

      public Element setPresentationStyle(PresentationStyle style)
      This method can be used to override the style of the runtime element. The style of an element is optional, so this method may also be used to clear any existing style information by invoking this method with a null value.
      Parameters:
      style - The new style information for the element.
      Returns:
      Pointer to this element to allow method chaining.
    • setFocus

      public Element setFocus(boolean focus)
      This method can be used to override the focus of the runtime element. The focus of an element is default set to false.
      Parameters:
      focus - The new focus setting for the element.
      Returns:
      Pointer to this element to allow method chaining.
    • hasFocus

      public boolean hasFocus()
      Description copied from interface: IElement
      This method returns a boolean indicating if this element has the focus.
      Specified by:
      hasFocus in interface IElement
      Returns:
      boolean
    • isReadonlyInheritFromParent

      public boolean isReadonlyInheritFromParent()
      Description copied from interface: IElement
      This method returns a boolean indicating whether to inherit the readonly state from its parent container.
      Specified by:
      isReadonlyInheritFromParent in interface IElement
      Returns:
      boolean indicating whether to inherit the readonly state from its parent container.
    • setReadonlyInheritFromParent

      public Element setReadonlyInheritFromParent(boolean inheritFromParent)
      This method can be used to change the behavior of whether to inherit the readonly state from its parent container.
      Parameters:
      inheritFromParent - The new readonly inherit from parent behavior for the element.
      Returns:
      Pointer to this element to allow method chaining.
    • isReadonly

      public final boolean isReadonly()
      Description copied from interface: IElement
      This method returns a boolean indicating if the element should be displayed read-only. An element is read-only when the element itself is specified as being read-only, or when IElement.isReadonlyInheritFromParent() returns true and the parent container (if available) is marked as read-only.
      Specified by:
      isReadonly in interface IElement
      Returns:
      boolean indicating if the element should be displayed read-only.
    • setReadonly

      public Element setReadonly(boolean isReadonly)
      This method can be used to change the read-only status of the runtime element. When this method is invoked with the same read-only setting as was already defined, the method call will be ignored. When the read-only status of the element has changed, the listener (if set) will be invoked to notified of the change.
      Parameters:
      isReadonly - The new read-only status for the element.
      Returns:
      Pointer to this element to allow method chaining.
    • isVisible

      public boolean isVisible()
      Description copied from interface: IElement
      This method returns a boolean indicating if the element should be visible. An element is visible when the element itself is specified as being visible and the parent container (if available) is visible.
      Specified by:
      isVisible in interface IElement
      Returns:
      boolean indicating if the element should be visible.
    • setVisible

      public Element setVisible(boolean visible)
      This method can be used to change the visibility of the runtime element. When this method is invoked with the same visibility setting as was already defined, the method call will be ignored. When the visibility status of the element has changed, the listener (if set) will be invoked to notified of the change.
      Parameters:
      visible - The new visibility status for the element.
      Returns:
      Pointer to this element to allow method chaining.
    • getVisibilityCondition

      public String getVisibilityCondition()
    • setVisibilityCondition

      public void setVisibilityCondition(String visibilityCondition)
    • getProperty

      public Serializable getProperty(String key)
      Description copied from interface: IElement
      This method returns the property for the specified key. If no property was defined for the specified key, a null value will be returned.
      Specified by:
      getProperty in interface IElement
      Parameters:
      key - The key for which the property value is requested.
      Returns:
      The property value for the specified key, or null if no property was added for that key.
    • setProperty

      public Serializable setProperty(String key, Serializable propertyValue)
      Description copied from interface: IElement
      This method will add the property value for the specified property key. If the property value is null, any existing property for that key will be removed.
      Specified by:
      setProperty in interface IElement
      Parameters:
      key - The key for which the property value should be set.
      propertyValue - The property value that should be set.
      Returns:
      The previous value that was present for the specified key.
    • getPropertyKeys

      public String[] getPropertyKeys()
      Description copied from interface: IElement
      This method returns all the property keys for which a property value has been added to this element.
      Specified by:
      getPropertyKeys in interface IElement
      Returns:
      An array containing all the property keys for which a value is present.
    • accept

      public IVisitor accept(IVisitor visitor)
      This method will invoke the visitor for this runtime element.
      Specified by:
      accept in interface IElement
      Parameters:
      visitor - The visitor that should be invoked.
      Returns:
      The visitor passed to this method.
      Throws:
      AppException - This exception may be raised by the visitor implementation.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object