Class FailedElement

All Implemented Interfaces:
ICompositeElement, IContainer, IElement, Serializable

public class FailedElement extends Container
This class element is used to represent an element that failed expansion. The main reason for this class is to provide feedback to the client that an element is present, but can't be displayed due to an error.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • FailedElement

      protected FailedElement(FailedElement other)
    • FailedElement

      public FailedElement(Throwable error, String name, ElementType type)
      Constructs a failed element with the cause of the failure and the name and type of the element that failed expansion.
      Parameters:
      error - The cause of the failure.
      name - The name of the element that failed expansion.
      type - The type of the element that failed expansion.
    • FailedElement

      public FailedElement(Throwable error, String name, ElementType type, String message)
      Constructs a failed element with the cause of the failure, the name and type of the element that failed expansion, and a message explaining the cause of the failure.
      Parameters:
      error - The cause of the failure.
      name - The name of the element that failed expansion.
      type - The type of the element that failed expansion.
      message - A message explaining the cause of the failure.
    • FailedElement

      public FailedElement(Throwable error, String name, ElementType type, IMultilingualText message)
      Constructs a failed element with the cause of the failure, the name and type of the element that failed expansion, and a message explaining the cause of the failure.
      Parameters:
      error - The cause of the failure.
      name - The name of the element that failed expansion.
      type - The type of the element that failed expansion.
      message - A message explaining the cause of the failure.
    • FailedElement

      public FailedElement(Throwable error, String name, ElementType type, IParameters parameters)
      Constructs a failed element with the cause of the failure, the name and type of the element that failed expansion, and an object containing additional parameters to identify the failure.
      Parameters:
      error - The cause of the failure.
      name - The name of the element that failed expansion.
      type - The type of the element that failed expansion.
      parameters - an object containing additional parameters that help identify the cause of the failure.
  • Method Details

    • duplicate

      public Element duplicate()
      Description copied from class: Container
      This method duplicates the container element.
      Specified by:
      duplicate in interface IElement
      Overrides:
      duplicate in class Container
      Returns:
      A clone of this element.
    • getType

      public ElementType getType()
      This method returns the type of the element that failed expansion.
      Returns:
      the type of the element that failed expansion.
    • getMessage

      public IMultilingualText getMessage()
      This method returns the message explaining the failure.
      Returns:
      the message explaining the failure.
    • getParameters

      public IParameters getParameters()
      This method returns an object containing additional parameters that help identify the cause of the failure.
      Returns:
      an object containing additional parameters that help identify the cause of the failure.
    • getStackTrace

      public String getStackTrace()
      This method returns the stack trace of the failure.
      Returns:
      the stack trace of the failure.
    • 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
      Overrides:
      isVisible in class Element
      Returns:
      boolean indicating if the element should be visible.
    • toString

      public String toString()
      Overrides:
      toString in class Container