Class VisitorWiretap<T>

java.lang.Object
io.sundr.builder.VisitorWiretap<T>
All Implemented Interfaces:
Visitor<T>

public class VisitorWiretap<T> extends Object implements Visitor<T>
  • Method Details

    • create

      public static <T> VisitorWiretap<T> create(Visitor<T> visitor, Collection<VisitorListener> listeners)
    • getRequirement

      public Predicate<List<Map.Entry<String,Object>>> getRequirement()
      Description copied from interface: Visitor
      Gets the requirement predicate for this visitor. The predicate determines whether this visitor should process a given path.
      Specified by:
      getRequirement in interface Visitor<T>
      Returns:
      a predicate that evaluates to true if this visitor should process the path
    • canVisit

      public <F> Boolean canVisit(List<Map.Entry<String,Object>> path, F target)
      Specified by:
      canVisit in interface Visitor<T>
    • order

      public int order()
      Description copied from interface: Visitor
      Gets the processing order for this visitor. Visitors with lower order values are processed first.
      Specified by:
      order in interface Visitor<T>
      Returns:
      the order value, defaults to 0
    • visit

      public void visit(T target)
      Description copied from interface: Visitor
      Visits the specified element.
      Specified by:
      visit in interface Visitor<T>
      Parameters:
      target - the element to visit
    • visit

      public void visit(List<Map.Entry<String,Object>> path, T target)
      Description copied from interface: Visitor
      Visits the specified element with path information. By default, this delegates to the simple visit method.
      Specified by:
      visit in interface Visitor<T>
      Parameters:
      path - the path to the element being visited
      target - the element to visit
    • getType

      public Class<T> getType()
      Description copied from interface: Visitor
      Gets the type of objects this visitor can handle. Uses reflection to determine the generic type parameter.
      Specified by:
      getType in interface Visitor<T>
      Returns:
      the class of objects this visitor handles, or null if not determinable
    • toString

      public String toString()
      Overrides:
      toString in class Object