Class ElementFinderVisitor

java.lang.Object
com.aquima.interactions.composer.model.ElementFinderVisitor
All Implemented Interfaces:
IVisitor

public class ElementFinderVisitor extends Object implements IVisitor
This class implements a visitor that may be used to locate an element with a specific key.
Since:
5.0
Author:
Jon van Leuven.
  • Constructor Details

    • ElementFinderVisitor

      public ElementFinderVisitor(RuntimeKey key)
      Constructs the finder visitor with the key of the element that needs to be located.
      Parameters:
      key - The key of the element that needs to be located.
  • Method Details

    • getElement

      public IElement getElement()
      This method returns the element with the specified runtime key. If no element could be found for the specified key, a null value is returned.
      Returns:
      The element for the specified key, or null when no matching element could be found.
    • accept

      public IVisitor accept(IElement element)
      Description copied from interface: IVisitor
      This method will be invoked for each element that is encountered during the visit. The return type of this method is the visitor that should be used to process the child elements of the current element. When the current element does not have any children, or when the child elements should not be processed, this method should return a null value as result. The returned visitor may either be a new visitor, for instance with specific context information for the element, or the same visitor.
      Specified by:
      accept in interface IVisitor
      Parameters:
      element - The current element that is encountered by the visitor.
      Returns:
      A visitor that should be used to process child elements.
    • leave

      public void leave(ICompositeElement container, IVisitor childVisitor)
      Description copied from interface: IVisitor
      This method will be invoked after all the children of the specified container have been processed with the childVisitor. The implementation of this method may choose to merge the results of the child visitor with this visitor.
      Specified by:
      leave in interface IVisitor
      Parameters:
      container - The container of whom the child visitor has completed.
      childVisitor - The child visitor that was used to evaluate the children of the container.