Class PathAwareTypedVisitor<V,P>

java.lang.Object
io.sundr.builder.PathAwareTypedVisitor<V,P>
All Implemented Interfaces:
Visitor<V>

public class PathAwareTypedVisitor<V,P> extends Object implements Visitor<V>
  • Constructor Details

    • PathAwareTypedVisitor

      public PathAwareTypedVisitor()
  • Method Details

    • visit

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

      public void visit(List<Map.Entry<String,Object>> path, V element)
      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<V>
      Parameters:
      path - the path to the element being visited
      element - the element to visit
    • hasVisitMethodMatching

      public <F> Boolean hasVisitMethodMatching(F target)
      Checks if the specified visitor has a visit method compatible with the specified fluent.
      Specified by:
      hasVisitMethodMatching in interface Visitor<V>
      Type Parameters:
      F - The type of the candidate
      Parameters:
      target - The candidate to check if current visitor can visit.
      Returns:
      True if matching method was found.
    • getParent

      public P getParent(List<Object> path)
    • getParentType

      public Class<P> getParentType()
    • getType

      public Class<V> 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<V>
      Returns:
      the class of objects this visitor handles, or null if not determinable