Class AbstractReference

java.lang.Object
com.aquima.interactions.composer.model.definition.AbstractReference
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ElementReference, InlineReference

public abstract class AbstractReference extends Object implements Serializable
Base class for references that can be added to containers/composite elements.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

  • Method Details

    • duplicate

      public abstract AbstractReference duplicate()
      This method duplicates the definition and returns the copy.
      Returns:
      Duplicate of the current element definition.
    • isInlineReference

      public abstract boolean isInlineReference()
      This method returns true if the reference is inline, so the reference contains the element definition.
      Returns:
      Boolean indicating if the reference is an inline reference.
    • getTargetName

      public String getTargetName()
      This method returns the name of the element this reference refers to. This method will return null for inline anonymous references.
      Returns:
      The name of the referred element.
    • getTargetType

      public ElementType getTargetType()
      This method returns the type of the element this reference refers to.
      Returns:
      The type of the referred element, never null.
    • isInternalDefinition

      protected boolean isInternalDefinition()
    • setInternalDefinition

      protected void setInternalDefinition(boolean isInternal)
    • addPresentationStyle

      public void addPresentationStyle(PresentationStyle style)
      This method adds the new style passed to the method to the reference.
      Parameters:
      style - The style to add for the reference.
      Since:
      7.4
    • getPresentationStyles

      public PresentationStyle[] getPresentationStyles()
      This method returns the current styles associated with the reference. The style of a reference is optional, and as such, this method may return an empty array, but never null.
      Returns:
      The styles of the reference, never null, but could be an empty array.
    • getPresentationStyleCondition

      public ICondition getPresentationStyleCondition(PresentationStyle presentationStyle)
      Returns the precondition of a presentationStyle.
      Parameters:
      presentationStyle - The presentationStyle, not null.
      Returns:
      The condition for the presentationStyle, or null if not applicable.
    • getReadonlyCondition

      public ICondition getReadonlyCondition()
      This method returns the condition object that should be used to determine if the object referred should be shown read-only. This method may return null when no condition has been set.
      Returns:
      The condition object to determine the read-only status of the element referred.
    • setReadonlyCondition

      public void setReadonlyCondition(ICondition condition)
      This method sets the read-only condition for the reference. The condition is evaluated during the expand to determine if the object that is referred should be read-only. When the condition is not set (is a null value) the element will not be read-only.
      Parameters:
      condition - The new read-only condition for the reference (optional).
    • getVisibleCondition

      public ICondition getVisibleCondition()
      This method returns the condition object that should be used to determine if the object referred should be visible. This method may return null when no condition has been set.
      Returns:
      The condition object to determine the visibility status of the element referred.
    • setVisibleCondition

      public void setVisibleCondition(ICondition condition)
      This method sets the visible condition for the reference. The condition is evaluated during the expand to determine if the object that is referred should be visible. When the condition is not set (is a null value) the element will be visible.
      Parameters:
      condition - The new visible condition for the reference (optional).
    • isRefresh

      public boolean isRefresh()
      This method returns the refresh indication for the reference. When refresh is set to true, an event triggered by the element referred will be treated as refresh event, where as a value of false will cause the event to be treated as a submit.
      Returns:
      boolean containing the refresh indication for the reference.
    • setRefresh

      public void setRefresh(boolean refresh)
      This method can be used to toggle the refresh status of the reference. The refresh status is only applicable for reference that refer to an element which can trigger an event (for instance a button or field). When refresh is set to false (default) an event triggered by the referred element will be treated as a submit event.
      Parameters:
      refresh - Boolean indicating if an event triggered by the element referred should be treated as a refresh event.
    • getButtonActions

      public String[] getButtonActions()
      This method returns the actions array for the referred element.
      Returns:
      The actions array for the referred element, may be null.
    • setButtonActions

      public void setButtonActions(String... actions)
      This method will set the action string for the element that is referred. The action string is only applicable for references to elements that can trigger an event. When such an element triggers an event, the action string will be propagated, and can be used to identify the type of action/button.
      Parameters:
      actions - String array containing the action names that should be assigned to the element referred.
    • getButtonEvent

      public String getButtonEvent()
      This method returns the button event string for the referred element.
      Returns:
      The event string for the referred element, may be null.
    • setButtonEvent

      public void setButtonEvent(String eventName)
      This method sets the button event that should be used for the button element that is referred to.
      Parameters:
      eventName - the event that should be used for the button element that is referred to.
    • getAssetFormat

      public String getAssetFormat()
      This method returns the asset format that should be used for the text element that is referred to. The asset format is only relevant when this reference actually refers to a text element.
      Returns:
      the asset format that should be used for the text element that is referred to.
    • setAssetFormat

      public void setAssetFormat(String format)
      This method sets the asset format that should be used for the text element that is referred to. The asset format is only relevant when this reference actually refers to a text element.
      Parameters:
      format - the asset format that should be used for the text element that is referred to.
    • getCreateInstanceForEmptyRelation

      public boolean getCreateInstanceForEmptyRelation()
      This method returns a boolean indicating if an instance should automatically be created when the associated relation attribute is empty during the expand phase.
      Returns:
      boolean indicating the automatic creation behavior of instances for the associated relation attribute.
    • setCreateInstanceForEmptyRelation

      public void setCreateInstanceForEmptyRelation(boolean createInstance)
      This method toggles the create-instance setting for references that are associated with a relation attribute. When there is no relation attribute associated with this reference, this method has no effect. The create-instance settings controls the behavior when during the expand an empty relation is encountered. When the create-instance is set to true, a new instance will automatically be created.
      Parameters:
      createInstance - boolean indicating if an instance should be created if needed for the associated relation attribute.
    • getActivateInstanceForRelation

      public boolean getActivateInstanceForRelation()
      This method returns a boolean indicating if instances from a relation should be made active when expanding the contents. At the moment this is directly linked to the "create instance for empty relation" setting.
      Returns:
      boolean indicating if instances from a relation should be made active when expanding the contents.
    • getDisplayLength

      public int getDisplayLength()
      This method returns the maximum length of the referenced element (usually a field).
      Returns:
      the maximum length of the referenced element.
    • getRepeatExpression

      public IRepeatExpression getRepeatExpression()
      This method returns the optional repeat expression that should be used to determine the context of the element. The repeat expression can be a relation attribute containing the instance that should be active when evaluating the content item that is referred to.
      Returns:
      The expression that should be used to determine the context.
    • setRepeatExpression

      public void setRepeatExpression(IRepeatExpression expression)
      This method sets the optional expression that should be used to determine the content of the element. The context expression is usually a relation attribute containing the instance that should be active when evaluating the content item that is referred to.
      Parameters:
      expression - The expression that should be used to determine the context.
    • getMaskCallName

      public String getMaskCallName()
      This method return an optional mask that should be used for determining a display value for the element this reference refers to (usually a field).
      Returns:
      The mask definition, may be null.
    • setMaskCallName

      public void setMaskCallName(String maskCallName)
      This method can be used to set the mask for this reference.
      Parameters:
      maskCallName - The mask call name.
    • getWidth

      public IntegerValue getWidth()
      This method returns the image width.
      Returns:
      Image width (may be null)
    • setWidth

      public void setWidth(IntegerValue width)
      This method can be used to set the width of the image that is referenced.
      Parameters:
      width - the width of the image that is referenced.
    • getHeight

      public IntegerValue getHeight()
      This method returns the image height.
      Returns:
      Image height (may be null)
    • setHeight

      public void setHeight(IntegerValue height)
      This method can be used to set the height of the image that is referenced.
      Parameters:
      height - the height of the image that is referenced.
    • getDisplayText

      public IDynamicText getDisplayText()
      This method returns the display text that is used for this reference, for example to overwrite the display text of a container.
      Returns:
      The display text for this reference, may be null.
    • setDisplayText

      public void setDisplayText(IDynamicText displayText)
      This method sets the display text of this reference.
      Parameters:
      displayText - The display text to use for this reference.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getContentStyle

      public ContentStyle getContentStyle()
      The containment determines can override the content style in which an element is shown.
      Returns:
      The content style for the element the reference refers to, may be null
    • setContentStyle

      public void setContentStyle(ContentStyle style)
      This method sets the content style of the reference to the new style passed to the method.
      Parameters:
      style - The new content style for the reference.