Interface IElement

All Superinterfaces:
Serializable
All Known Subinterfaces:
IAsset, IButton, ICompositeElement, IContainer, IContentItem, IDocument, IField, IImage, IPage, ITextItem
All Known Implementing Classes:
AnsweredContainer, Asset, Button, ButtonContainer, CompositeElement, Container, ContainerDelegate, ContentItem, Document, Element, FailedElement, Field, HiddenElement, Image, InstanceListOrder, Link, Page, QuestionsContainer, SolutionsContainer, Table, TableCell, TableContainer, TableElement, TableHeader, TableRow, TextItem, TreeListContainer

public interface IElement extends Serializable
Base interface for all elements on a runtime page.
Since:
5.0
Author:
O. Kerpershoek
  • Method Summary

    Modifier and Type
    Method
    Description
    accept(IVisitor visitor)
    This method will traverse the element structure and invoke the visitor for each element.
    This method should clone the element and return the cloned element.
    This method returns the name of the element.
    This method returns the parent container the element is contained in, or null if the element is not assigned to a container.
    This method will return the styles that should be used when rendering the element.
    This method returns the property for the specified key.
    This method returns all the property keys for which a property value has been added to this element.
    This method will return the unique identifier of the element within a page.
    boolean
    This method returns a boolean indicating if this element has the focus.
    boolean
    This method will return true if the PresentationStyle is present on this element.
    boolean
    This method returns a boolean indicating if the element should be displayed read-only.
    boolean
    This method returns a boolean indicating whether to inherit the readonly state from its parent container.
    boolean
    This method returns a boolean indicating if the element should be visible.
    setProperty(String key, Serializable propertyValue)
    This method will add the property value for the specified property key.
  • Method Details

    • getRuntimeKey

      RuntimeKey getRuntimeKey()
      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.
      Returns:
      The unique runtime key of the element within a page.
    • getParent

      ICompositeElement getParent()
      This method returns the parent container the element is contained in, or null if the element is not assigned to a container.
      Returns:
      The parent container of the element.
    • duplicate

      Element duplicate()
      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.
      Returns:
      The cloned (duplicate) element.
    • getName

      String getName()
      This method returns the name of the element. This name corresponds to the name of the element definition the element is based upon.
      Returns:
      The name of the element (not null)
    • getPresentationStyles

      PresentationStyle[] getPresentationStyles()
      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).
      Returns:
      The styles information of the element, never null, but could be an empty array.
    • hasPresentationStyle

      boolean hasPresentationStyle(PresentationStyle style)
      This method will return true if the PresentationStyle is present on this element.
      Parameters:
      style - The PresentationStyle to find
      Returns:
      True if the presentationStyle was present, false otherwise.
    • isReadonly

      boolean isReadonly()
      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 isReadonlyInheritFromParent() returns true and the parent container (if available) is marked as read-only.
      Returns:
      boolean indicating if the element should be displayed read-only.
    • isReadonlyInheritFromParent

      boolean isReadonlyInheritFromParent()
      This method returns a boolean indicating whether to inherit the readonly state from its parent container.
      Returns:
      boolean indicating whether to inherit the readonly state from its parent container.
    • isVisible

      boolean isVisible()
      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.
      Returns:
      boolean indicating if the element should be visible.
    • hasFocus

      boolean hasFocus()
      This method returns a boolean indicating if this element has the focus.
      Returns:
      boolean
    • getProperty

      Serializable getProperty(String key)
      This method returns the property for the specified key. If no property was defined for the specified key, a null value will be returned.
      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

      Serializable setProperty(String key, Serializable propertyValue)
      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.
      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

      String[] getPropertyKeys()
      This method returns all the property keys for which a property value has been added to this element.
      Returns:
      An array containing all the property keys for which a value is present.
    • accept

      IVisitor accept(IVisitor visitor)
      This method will traverse the element structure and invoke the visitor for each element.
      Parameters:
      visitor - The visitor that should be used to traverse the structure with.
      Returns:
      The visitor that should be used to process child element, or null when the child elements should not be processed.
      Throws:
      AppException - This exception may be raised by the implementation of the visitor.